|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.castor.cache.AbstractBaseCache
org.castor.cache.hashbelt.AbstractHashbelt
An abstract, core implementation of the hashbelt functionality; individual implementations will differ on the underlying behavior.
A hashbelt has six important values which get set at initialization:
| Nested Class Summary |
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
| Field Summary | |
static int |
DEFAULT_CAPACITY
Default capacity of cache. |
static java.lang.Class |
DEFAULT_CONTAINER_CLASS
Default container class. |
static int |
DEFAULT_CONTAINERS
Default number of containers for cache. |
static int |
DEFAULT_MONITOR
Default monitor interval of cache in minutes. |
static java.lang.Class |
DEFAULT_REAPER_CLASS
Default reaper class. |
static int |
DEFAULT_TTL
Default ttl of cache in seconds. |
static java.lang.String |
PARAM_CAPACITY
Mapped initialization parameter capacity. |
static java.lang.String |
PARAM_CONTAINER_CLASS
Mapped initialization parameter container-class. |
static java.lang.String |
PARAM_CONTAINERS
Mapped initialization parameter containers. |
static java.lang.String |
PARAM_MONITOR
Mapped initialization parameter monitor. |
static java.lang.String |
PARAM_REAPER_CLASS
Mapped initialization parameter reaper-class. |
static java.lang.String |
PARAM_TTL
Mapped initialization parameter ttl. |
| Fields inherited from interface org.castor.cache.Cache |
DEFAULT_DEBUG, DEFAULT_NAME, DEFAULT_TYPE, PARAM_DEBUG, PARAM_NAME, PARAM_TYPE |
| Constructor Summary | |
AbstractHashbelt()
|
|
| Method Summary | |
void |
clear()
|
void |
close()
Life-cycle method to allow custom resource cleanup for a cache implementation. |
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
java.util.Set |
entrySet()
|
int |
getCapacity()
Get real capacity of this cache. |
protected java.lang.Object |
getObjectFromCache(java.lang.Object key)
Get object currently associated with given key from cache. |
int |
getTTL()
Get real ttl of this cache. |
void |
initialize(java.util.Properties params)
Lyfe-cycle method to allow custom initialization of cache implementations. |
boolean |
isEmpty()
|
java.util.Set |
keySet()
|
protected org.castor.util.concurrent.ReadWriteLock |
lock()
Get reference to the ReadWriteLock of this cache instance. |
protected java.lang.Object |
putObjectIntoCache(java.lang.Object key,
java.lang.Object value)
Put given value with given key in cache. |
protected java.lang.Object |
removeObjectFromCache(java.lang.Object key)
Remove any available association for given key. |
int |
size()
|
java.util.Collection |
values()
|
| Methods inherited from class org.castor.cache.AbstractBaseCache |
expire, expireAll, getName, invokeMethod, invokeStaticMethod |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.castor.cache.Cache |
getType |
| Methods inherited from interface java.util.Map |
equals, get, hashCode, put, putAll, remove |
| Field Detail |
public static final java.lang.String PARAM_CONTAINERS
containers.
public static final java.lang.String PARAM_CONTAINER_CLASS
container-class.
public static final java.lang.String PARAM_REAPER_CLASS
reaper-class.
public static final java.lang.String PARAM_CAPACITY
capacity.
public static final java.lang.String PARAM_TTL
ttl.
public static final java.lang.String PARAM_MONITOR
monitor.
public static final int DEFAULT_CONTAINERS
public static final java.lang.Class DEFAULT_CONTAINER_CLASS
public static final java.lang.Class DEFAULT_REAPER_CLASS
public static final int DEFAULT_CAPACITY
public static final int DEFAULT_TTL
public static final int DEFAULT_MONITOR
| Constructor Detail |
public AbstractHashbelt()
| Method Detail |
public final void initialize(java.util.Properties params)
throws CacheAcquireException
initialize in interface Cacheinitialize in class AbstractBaseCacheCacheAcquireExceptionCache.initialize(java.util.Properties)public final void close()
close in interface Cacheclose in class AbstractBaseCacheCache.close()public final int getCapacity()
public final int getTTL()
public final int size()
Map.size()public final boolean isEmpty()
Map.isEmpty()public final boolean containsKey(java.lang.Object key)
Map.containsKey(java.lang.Object)public final boolean containsValue(java.lang.Object value)
Map.containsValue(java.lang.Object)public final void clear()
Map.clear()public final java.util.Set keySet()
Map.keySet()public final java.util.Collection values()
Map.values()public final java.util.Set entrySet()
Map.entrySet()protected final org.castor.util.concurrent.ReadWriteLock lock()
protected final java.lang.Object getObjectFromCache(java.lang.Object key)
key - The key to return the associated object for.
protected final java.lang.Object putObjectIntoCache(java.lang.Object key,
java.lang.Object value)
key - The key to associate the given value with.value - The value to associate with given key.
null will
be returned if no value has been associated with key.protected final java.lang.Object removeObjectFromCache(java.lang.Object key)
key - The key to remove any previously associate value for.
null will
be returned if no value has been associated with key.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||