org.jboss.virtual.plugins.cache
Class CombinedVFSCache

java.lang.Object
  extended by org.jboss.virtual.plugins.cache.CombinedVFSCache
All Implemented Interfaces:
CacheStatistics, VFSCache

public class CombinedVFSCache
extends Object
implements VFSCache, CacheStatistics

Combined vfs cache - permanent entries + real cache.

Author:
Ales Justin

Constructor Summary
CombinedVFSCache()
           
 
Method Summary
 void create()
          Check at create.
 VFSContext findContext(URI uri)
          Find the context based on uri.
 VFSContext findContext(URL url)
          Find the context based on url.
 void flush()
          Flush the cache.
 Iterable<VFSContext> getCachedContexts()
          Get cached contexts.
 long lastInsert()
          Get last insert timestamp.
 void putContext(VFSContext context)
          Put vfs context to cache.
 void removeContext(VFSContext context)
          Remove vfs context from cache.
 void setPermanentRoots(Map<URL,ExceptionHandler> initializationEntries)
          Set permanent roots and its exception handlers.
 void setRealCache(VFSCache realCache)
          Set the real cache.
 int size()
          Get cache size.
 void start()
          Start the cache.
 void stop()
          Stop the cache.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CombinedVFSCache

public CombinedVFSCache()
Method Detail

setPermanentRoots

public void setPermanentRoots(Map<URL,ExceptionHandler> initializationEntries)
                       throws Exception
Set permanent roots and its exception handlers.

Parameters:
initializationEntries - the initialization entries
Throws:
IOException - for any error
Exception

setRealCache

public void setRealCache(VFSCache realCache)
Set the real cache.

Parameters:
realCache - the real cache

create

public void create()
Check at create.


findContext

public VFSContext findContext(URI uri)
Description copied from interface: VFSCache
Find the context based on uri.

Specified by:
findContext in interface VFSCache
Parameters:
uri - the uri
Returns:
found context or null

findContext

public VFSContext findContext(URL url)
Description copied from interface: VFSCache
Find the context based on url.

Specified by:
findContext in interface VFSCache
Parameters:
url - the url
Returns:
found context or null

putContext

public void putContext(VFSContext context)
Description copied from interface: VFSCache
Put vfs context to cache.

Specified by:
putContext in interface VFSCache
Parameters:
context - the vfs context

removeContext

public void removeContext(VFSContext context)
Description copied from interface: VFSCache
Remove vfs context from cache.

Specified by:
removeContext in interface VFSCache
Parameters:
context - the vfs context

start

public void start()
           throws Exception
Description copied from interface: VFSCache
Start the cache.

Specified by:
start in interface VFSCache
Throws:
Exception - for any error

stop

public void stop()
Description copied from interface: VFSCache
Stop the cache.

Specified by:
stop in interface VFSCache

flush

public void flush()
Description copied from interface: VFSCache
Flush the cache.

Specified by:
flush in interface VFSCache

getCachedContexts

public Iterable<VFSContext> getCachedContexts()
Description copied from interface: CacheStatistics
Get cached contexts.

Specified by:
getCachedContexts in interface CacheStatistics
Returns:
the cached contexts

size

public int size()
Description copied from interface: CacheStatistics
Get cache size.

Specified by:
size in interface CacheStatistics
Returns:
the cache size

lastInsert

public long lastInsert()
Description copied from interface: CacheStatistics
Get last insert timestamp.

Specified by:
lastInsert in interface CacheStatistics
Returns:
the last insert timestamp

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009 JBoss, A division of Red Hat, Inc. All Rights Reserved.