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

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

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

Tree base structure cache.

Author:
Ales Justin

Constructor Summary
TreeStructureCache()
           
 
Method Summary
protected  org.jboss.deployers.vfs.spi.structure.modified.TreeStructureCache.Node<T> createRoot()
          Create new root.
 void flush()
          Flush the cache.
 T getCacheValue(String pathName)
          Get cache value.
protected  T getDefaultValue()
          Get default node value.
 Set<String> getLeaves(String pathName)
          Get leaves for this path name parameter.
protected  org.jboss.deployers.vfs.spi.structure.modified.TreeStructureCache.Node<T> getNode(String path)
          Get the path's node.
 void initializeCache(String pathName)
          Initialize cache.
protected  org.jboss.deployers.vfs.spi.structure.modified.TreeStructureCache.Node<T> initializeNode(String pathName)
          Initialize node for pathName param.
 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

TreeStructureCache

public TreeStructureCache()
Method Detail

createRoot

protected org.jboss.deployers.vfs.spi.structure.modified.TreeStructureCache.Node<T> createRoot()
Create new root.

Returns:
the new root

getDefaultValue

protected T getDefaultValue()
Get default node value.

Returns:
the default node value

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>

getNode

protected org.jboss.deployers.vfs.spi.structure.modified.TreeStructureCache.Node<T> getNode(String path)
Get the path's node.

Parameters:
path - the path
Returns:
node or null if it doesn't exist

initializeNode

protected org.jboss.deployers.vfs.spi.structure.modified.TreeStructureCache.Node<T> initializeNode(String pathName)
Initialize node for pathName param.

Parameters:
pathName - the path name
Returns:
initialized node


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