public class ItemInfoCacheImpl extends Object implements org.apache.jackrabbit.spi.ItemInfoCache
ItemInfoCache has a default size of 5000 items.
Item infos are put into the cache after they have been read from the RepositoryService.
If the cache is full, the oldest item is discarded. Reading items removes them
from the cache.
The underlying idea here is, that ItemInfos which are supplied by the
RepositoryService but not immediately needed are put into the
cache to avoid further round trips to RepositoryService.
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.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CACHE_SIZE
Default size of the cache.
|
| Constructor and Description |
|---|
ItemInfoCacheImpl()
Create a new instance with the default cache size.
|
ItemInfoCacheImpl(int cacheSize)
Create a new instance with a given cache size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
org.apache.jackrabbit.spi.ItemInfoCache.Entry<org.apache.jackrabbit.spi.NodeInfo> |
getNodeInfo(org.apache.jackrabbit.spi.NodeId nodeId)
This implementation removes the item from the cache
if it is present.
|
org.apache.jackrabbit.spi.ItemInfoCache.Entry<org.apache.jackrabbit.spi.PropertyInfo> |
getPropertyInfo(org.apache.jackrabbit.spi.PropertyId propertyId)
This implementation removes the item from the cache
if it is present.
|
void |
put(org.apache.jackrabbit.spi.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.
|
public static final int DEFAULT_CACHE_SIZE
public ItemInfoCacheImpl()
DEFAULT_CACHE_SIZEpublic ItemInfoCacheImpl(int cacheSize)
cacheSize - public org.apache.jackrabbit.spi.ItemInfoCache.Entry<org.apache.jackrabbit.spi.NodeInfo> getNodeInfo(org.apache.jackrabbit.spi.NodeId nodeId)
nodeId
id uuid based, and no item is found by the nodeId
a second lookup is done by the path.getNodeInfo in interface org.apache.jackrabbit.spi.ItemInfoCachepublic org.apache.jackrabbit.spi.ItemInfoCache.Entry<org.apache.jackrabbit.spi.PropertyInfo> getPropertyInfo(org.apache.jackrabbit.spi.PropertyId propertyId)
propertyId
id uuid based, and no item is found by the propertyId
a second lookup is done by the path.getPropertyInfo in interface org.apache.jackrabbit.spi.ItemInfoCachepublic void put(org.apache.jackrabbit.spi.ItemInfo info,
long generation)
put in interface org.apache.jackrabbit.spi.ItemInfoCachepublic void dispose()
dispose in interface org.apache.jackrabbit.spi.ItemInfoCacheCopyright © 2004–2017 The Apache Software Foundation. All rights reserved.