org.modeshape.graph.connector.base.cache
Class InMemoryNodeCache.PathCachePolicy
java.lang.Object
org.modeshape.graph.connector.base.cache.InMemoryNodeCache.PathCachePolicy
- All Implemented Interfaces:
- Serializable, CachePolicy, NodeCachePolicy<Path,PathNode>
- Enclosing class:
- InMemoryNodeCache<KeyType,NodeType extends Node>
public static class InMemoryNodeCache.PathCachePolicy
- extends Object
- implements NodeCachePolicy<Path,PathNode>
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InMemoryNodeCache.PathCachePolicy
public InMemoryNodeCache.PathCachePolicy()
InMemoryNodeCache.PathCachePolicy
public InMemoryNodeCache.PathCachePolicy(long timeToLiveInSeconds)
shouldCache
public boolean shouldCache(PathNode node)
- Description copied from interface:
NodeCachePolicy
- Indicates whether the node should be cached .
- Specified by:
shouldCache
in interface NodeCachePolicy<Path,PathNode>
- Parameters:
node
- the node that may or may not be cached; may not be null
- Returns:
- true for all nodes
- See Also:
NodeCachePolicy.shouldCache(Node)
getTimeToLive
public long getTimeToLive()
- Description copied from interface:
CachePolicy
- Get the system time in milliseconds before which the node data remains valid.
- Specified by:
getTimeToLive
in interface CachePolicy
- Returns:
- the number of milliseconds that the cached data should be used before consulting the original source.
setTimeToLive
public void setTimeToLive(long timeToLiveInSeconds)
newCache
public InMemoryNodeCache.PathCache newCache()
- Description copied from interface:
NodeCachePolicy
- Return a new cache instance that
uses this policy
.
- Specified by:
newCache
in interface NodeCachePolicy<Path,PathNode>
- Returns:
- the cache class
Copyright © 2008-2011 JBoss, a division of Red Hat. All Rights Reserved.