|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.modeshape.graph.connector.path.cache.InMemoryWorkspaceCache
@ThreadSafe public class InMemoryWorkspaceCache

Implementation of WorkspaceCache that stores all nodes in-memory.
| Nested Class Summary | |
|---|---|
static class |
InMemoryWorkspaceCache.InMemoryCachePolicy
Trivial path cache policy implementation that caches all nodes in an in-memory cache. |
| Constructor Summary | |
|---|---|
InMemoryWorkspaceCache()
|
|
| Method Summary | |
|---|---|
void |
clearStatistics()
Clears all statistics for this cache |
void |
close()
Indicates that the cache is no longer in use and should relinquish any resources. |
PathNode |
get(Path path)
Retrieves the cached node with the given path, it it exists and is valid |
CacheStatistics |
getStatistics()
|
void |
initialize(PathCachePolicy policy,
String workspaceName)
Injects the cache policy into the cache |
void |
invalidate(Path path)
Invalidates all nodes in the cache that have the given path or have a path that is an ancestor of the given path |
protected PathCachePolicy |
policy()
|
void |
set(PathNode node)
Attempts to cache the given node. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InMemoryWorkspaceCache()
| Method Detail |
|---|
public void initialize(PathCachePolicy policy,
String workspaceName)
WorkspaceCache
initialize in interface WorkspaceCachepolicy - the active cache policy for the repository source with which this cache is associatedworkspaceName - the name of the workspace that this cache is managingprotected PathCachePolicy policy()
public void clearStatistics()
WorkspaceCache
clearStatistics in interface WorkspaceCachepublic CacheStatistics getStatistics()
getStatistics in interface WorkspaceCacheWorkspaceCache.clearStatistics();
never nullpublic PathNode get(Path path)
WorkspaceCache
get in interface WorkspaceCachepath - the path for the node to be retrieved
public void set(PathNode node)
WorkspaceCachePathCachePolicy.shouldCache(PathNode) on the policy
from the WorkspaceCache.initialize(PathCachePolicy, String) method to determine if the node should be cached.
set in interface WorkspaceCachenode - the node that is to be cached; may not be nullpublic void invalidate(Path path)
WorkspaceCache
invalidate in interface WorkspaceCachepath - the root of the branch of nodes that are to be invalidated; may not be nullpublic void close()
WorkspaceCache
close in interface WorkspaceCache
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||