|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.castor.cache.AbstractBaseCache
public abstract class AbstractBaseCache
Base implementation of all LRU cache types.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary |
---|
Fields inherited from interface org.castor.cache.Cache |
---|
DEFAULT_DEBUG, DEFAULT_NAME, DEFAULT_TYPE, PARAM_DEBUG, PARAM_NAME, PARAM_TYPE |
Constructor Summary | |
---|---|
AbstractBaseCache()
|
Method Summary | |
---|---|
void |
close()
Life-cycle method to allow custom resource cleanup for a cache implementation. |
void |
expire(java.lang.Object key)
Remove the mapping identified by key from the cache. |
void |
expireAll()
Removes all mappings from the cache. |
java.lang.String |
getName()
Get virtual name of this cache. |
void |
initialize(java.util.Properties params)
Lyfe-cycle method to allow custom initialization of cache implementations. |
protected java.lang.Object |
invokeMethod(java.lang.Object target,
java.lang.String name,
java.lang.Class<?>[] types,
java.lang.Object[] arguments)
Invoke method with given name and arguments having parameters of types specified on the given target. |
protected java.lang.Object |
invokeStaticMethod(java.lang.Class<?> target,
java.lang.String name,
java.lang.Class<?>[] types,
java.lang.Object[] arguments)
Invoke static method with given name and arguments having parameters of types specified on the given target. |
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 |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Constructor Detail |
---|
public AbstractBaseCache()
Method Detail |
---|
public void initialize(java.util.Properties params) throws CacheAcquireException
initialize
in interface Cache
params
- Parameters to initialize the cache (e.g. name, capacity).
CacheAcquireException
- If cache can not be initialized.public void close()
close
in interface Cache
public final java.lang.String getName()
getName
in interface Cache
public final void expire(java.lang.Object key)
expire
in interface Cache
key
- the key that needs to be removed.public final void expireAll()
expireAll
in interface Cache
protected final java.lang.Object invokeStaticMethod(java.lang.Class<?> target, java.lang.String name, java.lang.Class<?>[] types, java.lang.Object[] arguments) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
target
- The target object to invoke the method on.name
- The name of the method to invoke.types
- The types of the parameters.arguments
- The parameters.
java.lang.NoSuchMethodException
- If a matching method is not found or if the
name is "<init>"or "<clinit>".
java.lang.IllegalAccessException
- If this Method object enforces Java language
access control and the underlying method is inaccessible.
java.lang.reflect.InvocationTargetException
- If the underlying method throws an exception.protected final java.lang.Object invokeMethod(java.lang.Object target, java.lang.String name, java.lang.Class<?>[] types, java.lang.Object[] arguments) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
target
- The target object to invoke the method on.name
- The name of the method to invoke.types
- The types of the parameters.arguments
- The parameters.
java.lang.NoSuchMethodException
- If a matching method is not found or if the
name is "<init>"or "<clinit>".
java.lang.IllegalAccessException
- If this Method object enforces Java language
access control and the underlying method is inaccessible.
java.lang.reflect.InvocationTargetException
- If the underlying method throws an exception.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |