Package org.modeshape.graph.connector.path.cache

The PathRepositoryCache class and its supporting classes provide a standard caching mechanism for path-based repositories.

See:
          Description


Interface Summary
CacheStatistics This interface provides access to statistics for an individual workspace cache.
PathCachePolicy The provides a method for selectively allowing or disallowing nodes to be cached based on their size, volatility, or any other factor that can be determined for the node.
WorkspaceCache The basic contract for a workspace-level cache of paths to the nodes stored at that path.
 

Class Summary
DefaultCacheStatistics Default, thread-safe implementation of CacheStatistics that uses AtomicLongs as counters for the statistics.
InMemoryWorkspaceCache Implementation of WorkspaceCache that stores all nodes in-memory.
InMemoryWorkspaceCache.InMemoryCachePolicy Trivial path cache policy implementation that caches all nodes in an in-memory cache.
NoCachePolicy Trivial path cache policy implementation that performs no caching at all
PathRepositoryCache The repository-source level cache of workspace names to workspace caches.
 

Package org.modeshape.graph.connector.path.cache Description

The PathRepositoryCache class and its supporting classes provide a standard caching mechanism for path-based repositories. Users of any path repository based on AbstractPathRepositorySource can call AbstractPathRepositorySource.setCachePolicy(PathCachePolicy) to configure the caching for that repository. This method can be invoked at run-time to modify the cache properties of an in-use repository.

Each AbstractPathRepositorySource has a local instance of PathRepositoryCache that reads the PathCachePolicy for the source and uses it to create instances of WorkspaceCache for each workspace in the repository. When a workspace cache instance is requested for the first time from the PathRepositoryCache#getCache(String) method, an instance of the class is created using the no-argument constructor for the class and WorkspaceCache#initialize(PathCachePolicy, String) is called with the current cache policy.

When the cache policy is changed on the source, the existing PathRepositoryCache is closed and a new path repository cache is created.



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