|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@ThreadSafe public interface WorkspaceCache

The basic contract for a workspace-level cache of paths to the nodes stored at that path.
Implementations must provide a no-argument constructor in order to be instantiated by PathRepositoryCache. After
instantiation, the initialize(PathCachePolicy, String) method will be called to inject the cache policy into the
implementation.
Implementations must be thread-safe.
| 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 |
void |
set(PathNode node)
Attempts to cache the given node. |
| Method Detail |
|---|
void initialize(PathCachePolicy policy,
String workspaceName)
policy - the active cache policy for the repository source with which this cache is associatedworkspaceName - the name of the workspace that this cache is managing
IllegalStateException - if this method is called on a cache that has already been initialized.void clearStatistics()
CacheStatistics getStatistics()
clearStatistics();
never nullPathNode get(Path path)
path - the path for the node to be retrieved
void set(PathNode node)
PathCachePolicy.shouldCache(PathNode) on the policy
from the initialize(PathCachePolicy, String) method to determine if the node should be cached.
node - the node that is to be cached; may not be nullvoid invalidate(Path path)
path - the root of the branch of nodes that are to be invalidated; may not be nullvoid close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||