Class ItemInfoCacheImpl
- java.lang.Object
- 
- org.apache.jackrabbit.spi.commons.ItemInfoCacheImpl
 
- 
- All Implemented Interfaces:
- ItemInfoCache
 
 public class ItemInfoCacheImpl extends Object implements ItemInfoCache This implementation ofItemInfoCachehas a default size of 5000 items. Item infos are put into the cache after they have been read from theRepositoryService. If the cache is full, the oldest item is discarded. Reading items removes them from the cache. The underlying idea here is, thatItemInfos which are supplied by theRepositoryServicebut not immediately needed are put into the cache to avoid further round trips toRepositoryService. When they are needed later, they are read from the cache. There is no need to keep them in this cache after that point since they are present in the hierarchy from then on.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.jackrabbit.spi.ItemInfoCacheItemInfoCache.Entry<T extends ItemInfo>
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static intDEFAULT_CACHE_SIZEDefault size of the cache.
 - 
Constructor SummaryConstructors Constructor Description ItemInfoCacheImpl()Create a new instance with the default cache size.ItemInfoCacheImpl(int cacheSize)Create a new instance with a given cache size.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Clear the cache and dispose all entries.ItemInfoCache.Entry<NodeInfo>getNodeInfo(NodeId nodeId)This implementation removes the item from the cache if it is present.ItemInfoCache.Entry<PropertyInfo>getPropertyInfo(PropertyId propertyId)This implementation removes the item from the cache if it is present.voidput(ItemInfo info, long generation)This implementation cached the item by its id and if the id is uuid based but has no path, also by its path.
 
- 
- 
- 
Field Detail- 
DEFAULT_CACHE_SIZEpublic static final int DEFAULT_CACHE_SIZE Default size of the cache.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
ItemInfoCacheImplpublic ItemInfoCacheImpl() Create a new instance with the default cache size.- See Also:
- DEFAULT_CACHE_SIZE
 
 - 
ItemInfoCacheImplpublic ItemInfoCacheImpl(int cacheSize) Create a new instance with a given cache size.- Parameters:
- cacheSize-
 
 
- 
 - 
Method Detail- 
getNodeInfopublic ItemInfoCache.Entry<NodeInfo> getNodeInfo(NodeId nodeId) This implementation removes the item from the cache if it is present. Furthermore if thenodeIdid uuid based, and no item is found by thenodeIda second lookup is done by the path.- Specified by:
- getNodeInfoin interface- ItemInfoCache
- Parameters:
- nodeId- id of the entry to lookup.
- Returns:
- a Entry<NodeInfo>instance ornullif not found.
 
 - 
getPropertyInfopublic ItemInfoCache.Entry<PropertyInfo> getPropertyInfo(PropertyId propertyId) This implementation removes the item from the cache if it is present. Furthermore if thepropertyIdid uuid based, and no item is found by thepropertyIda second lookup is done by the path.- Specified by:
- getPropertyInfoin interface- ItemInfoCache
- Parameters:
- propertyId- id of the entry to lookup.
- Returns:
- a Entry<PropertyInfo>instance ornullif not found.
 
 - 
putpublic void put(ItemInfo info, long generation) This implementation cached the item by its id and if the id is uuid based but has no path, also by its path.- Specified by:
- putin interface- ItemInfoCache
 
 - 
disposepublic void dispose() Description copied from interface:ItemInfoCacheClear the cache and dispose all entries.- Specified by:
- disposein interface- ItemInfoCache
 
 
- 
 
-