org.apache.jackrabbit.core.cache
Interface Cache

All Known Implementing Classes:
AbstractCache, ConcurrentCache

public interface Cache

A Cache object A cache must call CacheManager.getInstance().add(this) to take part in the dynamic memory distribution.


Method Summary
 long getAccessCount()
          Get the number of accesses (get or set) until resetAccessCount was called.
 long getMaxMemorySize()
          Get the current limit.
 long getMemoryUsed()
          Get the amount of used memory.
 void resetAccessCount()
          Reset the access counter.
 void setAccessListener(CacheAccessListener listener)
          Add a listener to this cache that is informed after a number of accesses.
 void setMaxMemorySize(long size)
          Set the new memory limit.
 

Method Detail

setMaxMemorySize

void setMaxMemorySize(long size)
Set the new memory limit.

Parameters:
size - the size in bytes

getMaxMemorySize

long getMaxMemorySize()
Get the current limit.

Returns:
the size in bytes

getMemoryUsed

long getMemoryUsed()
Get the amount of used memory.

Returns:
the size in bytes

getAccessCount

long getAccessCount()
Get the number of accesses (get or set) until resetAccessCount was called.

Returns:
the count

resetAccessCount

void resetAccessCount()
Reset the access counter.


setAccessListener

void setAccessListener(CacheAccessListener listener)
Add a listener to this cache that is informed after a number of accesses.



Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.