public abstract class AbstractBaseCache extends Object implements Cache
DEFAULT_DEBUG, DEFAULT_NAME, DEFAULT_TYPE, PARAM_DEBUG, PARAM_NAME, PARAM_TYPE
Constructor and Description |
---|
AbstractBaseCache() |
Modifier and Type | Method and Description |
---|---|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
public void initialize(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()
public final String getName()
public final void expire(Object key)
public final void expireAll()
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.Copyright © 2014. All rights reserved.