org.jboss.virtual.plugins.cache
Class AbstractVFSCache

java.lang.Object
  extended by org.jboss.virtual.plugins.cache.AbstractVFSCache
All Implemented Interfaces:
CacheStatistics, VFSCache
Direct Known Subclasses:
IterableVFSCache, PathMatchingVFSCache

public abstract class AbstractVFSCache
extends Object
implements VFSCache, CacheStatistics

Abstract vfs cache.

Author:
Ales Justin

Field Summary
protected  org.jboss.logging.Logger log
           
 
Constructor Summary
AbstractVFSCache()
           
 
Method Summary
protected abstract  void check()
          Is cache valid.
 VFSContext findContext(URL url)
          Find the context based on url.
protected abstract  VFSContext getContext(String path)
          Get the cached context.
 long lastInsert()
          Get last insert timestamp.
protected abstract  void putContext(String path, VFSContext context)
          Put vfs context and its path key into cache.
 void putContext(VFSContext context)
          Put vfs context to cache.
protected  void readLock()
          Read lock.
protected  void readUnlock()
          Read unlock.
protected abstract  void removeContext(String path, VFSContext context)
          Remove vfs context and its path key from cache.
 void removeContext(VFSContext context)
          Remove vfs context from cache.
protected  void writeLock()
          Write lock.
protected  void writeUnlock()
          Write unlock.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.virtual.spi.cache.VFSCache
findContext, flush, start, stop
 
Methods inherited from interface org.jboss.virtual.spi.cache.CacheStatistics
getCachedContexts, size
 

Field Detail

log

protected org.jboss.logging.Logger log
Constructor Detail

AbstractVFSCache

public AbstractVFSCache()
Method Detail

lastInsert

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

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

check

protected abstract void check()
Is cache valid.


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

getContext

protected abstract VFSContext getContext(String path)
Get the cached context.

Parameters:
path - the path to match
Returns:
cached context or null if not found

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

putContext

protected abstract void putContext(String path,
                                   VFSContext context)
Put vfs context and its path key into cache.

Parameters:
path - the context's path
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

removeContext

protected abstract void removeContext(String path,
                                      VFSContext context)
Remove vfs context and its path key from cache.

Parameters:
path - the context's path
context - the vfs context

readLock

protected void readLock()
Read lock.


readUnlock

protected void readUnlock()
Read unlock.


writeLock

protected void writeLock()
Write lock.


writeUnlock

protected void writeUnlock()
Write unlock.



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