|
||||||||||
| 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 |
|---|
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(Object key)
Remove the mapping identified by key from the cache. |
void |
expireAll()
Removes all mappings from the cache. |
String |
getName()
Get virtual name of this cache. |
void |
initialize(Properties params)
Lyfe-cycle method to allow custom initialization of cache implementations. |
protected Object |
invokeMethod(Object target,
String name,
Class<?>[] types,
Object[] arguments)
Invoke method with given name and arguments having parameters of types specified on the given target. |
protected Object |
invokeStaticMethod(Class<?> target,
String name,
Class<?>[] types,
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(Properties params)
throws CacheAcquireException
initialize in interface Cacheparams - Parameters to initialize the cache (e.g. name, capacity).
CacheAcquireException - If cache can not be initialized.public void close()
close in interface Cachepublic final String getName()
getName in interface Cachepublic final void expire(Object key)
expire in interface Cachekey - the key that needs to be removed.public final void expireAll()
expireAll in interface Cache
protected final Object invokeStaticMethod(Class<?> target,
String name,
Class<?>[] types,
Object[] arguments)
throws NoSuchMethodException,
IllegalAccessException,
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.
NoSuchMethodException - If a matching method is not found or if the
name is "<init>"or "<clinit>".
IllegalAccessException - If this Method object enforces Java language
access control and the underlying method is inaccessible.
InvocationTargetException - If the underlying method throws an exception.
protected final Object invokeMethod(Object target,
String name,
Class<?>[] types,
Object[] arguments)
throws NoSuchMethodException,
IllegalAccessException,
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.
NoSuchMethodException - If a matching method is not found or if the
name is "<init>"or "<clinit>".
IllegalAccessException - If this Method object enforces Java language
access control and the underlying method is inaccessible.
InvocationTargetException - If the underlying method throws an exception.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||