org.jboss.deployers.vfs.spi.structure.modified
Class DefaultStructureCache<T>

java.lang.Object
  extended by org.jboss.deployers.vfs.spi.structure.modified.DefaultStructureCache<T>
Type Parameters:
T - exact cache value type
All Implemented Interfaces:
StructureCache<T>

public class DefaultStructureCache<T>
extends Object
implements StructureCache<T>

Default structure cache.

Author:
Ales Justin

Constructor Summary
DefaultStructureCache()
           
 
Method Summary
 void flush()
          Flush the cache.
 T getCacheValue(String pathName)
          Get cache value.
 Set<String> getLeaves(String pathName)
          Get leaves for this path name parameter.
 void initializeCache(String pathName)
          Initialize cache.
 void invalidateCache(String pathName)
          Invalidate cache for path name.
 T putCacheValue(String pathName, T value)
          Put cache value.
 void removeCache(String pathName)
          Remove cache for path name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultStructureCache

public DefaultStructureCache()
Method Detail

initializeCache

public void initializeCache(String pathName)
Description copied from interface: StructureCache
Initialize cache.

Specified by:
initializeCache in interface StructureCache<T>
Parameters:
pathName - the path name

putCacheValue

public T putCacheValue(String pathName,
                       T value)
Description copied from interface: StructureCache
Put cache value.

Specified by:
putCacheValue in interface StructureCache<T>
Parameters:
pathName - the path name
value - the value
Returns:
previous value

getCacheValue

public T getCacheValue(String pathName)
Description copied from interface: StructureCache
Get cache value.

Specified by:
getCacheValue in interface StructureCache<T>
Parameters:
pathName - the path name
Returns:
the cache value

getLeaves

public Set<String> getLeaves(String pathName)
Description copied from interface: StructureCache
Get leaves for this path name parameter. Only exact sub path nodes count in. This method should return a mutable Set copy as we intend to modify it in checker processing.

Specified by:
getLeaves in interface StructureCache<T>
Parameters:
pathName - the path name
Returns:
sub-paths nodes or null if no such match yet

invalidateCache

public void invalidateCache(String pathName)
Description copied from interface: StructureCache
Invalidate cache for path name.

Specified by:
invalidateCache in interface StructureCache<T>
Parameters:
pathName - the path name

removeCache

public void removeCache(String pathName)
Description copied from interface: StructureCache
Remove cache for path name.

Specified by:
removeCache in interface StructureCache<T>
Parameters:
pathName - the path name

flush

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

Specified by:
flush in interface StructureCache<T>


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.