|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.spi.commons.ItemInfoCacheImpl
public class ItemInfoCacheImpl
This implementation of 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 the
from the cache.
The underlying idea here is, that ItemInfo
s 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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.jackrabbit.spi.ItemInfoCache |
---|
ItemInfoCache.Entry<T extends ItemInfo> |
Field Summary | |
---|---|
static int |
DEFAULT_CACHE_SIZE
Default size of the cache. |
Constructor Summary | |
---|---|
ItemInfoCacheImpl()
Create a new instance with the default cache size. |
|
ItemInfoCacheImpl(int cacheSize)
Create a new instance with a given cache size. |
Method Summary | |
---|---|
void |
dispose()
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. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_CACHE_SIZE
Constructor Detail |
---|
public ItemInfoCacheImpl()
DEFAULT_CACHE_SIZE
public ItemInfoCacheImpl(int cacheSize)
cacheSize
- Method Detail |
---|
public ItemInfoCache.Entry<NodeInfo> getNodeInfo(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 ItemInfoCache
nodeId
- id of the entry to lookup.
Entry<NodeInfo>
instance or null
if not found.public ItemInfoCache.Entry<PropertyInfo> getPropertyInfo(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 ItemInfoCache
propertyId
- id of the entry to lookup.
Entry<PropertyInfo>
instance or
null
if not found.public void put(ItemInfo info, long generation)
put
in interface ItemInfoCache
public void dispose()
ItemInfoCache
dispose
in interface ItemInfoCache
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |