|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.castor.cache.AbstractBaseCache<K,V>
org.castor.cache.distributed.AbstractDistributedCache<K,V>
K - the type of keys maintained by this cacheV - the type of cached valuespublic abstract class AbstractDistributedCache<K,V>
Base implementation of all distributed 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 | |
|---|---|
AbstractDistributedCache()
|
|
| Method Summary | |
|---|---|
void |
clear()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
Set<Map.Entry<K,V>> |
entrySet()
|
V |
get(Object key)
|
protected Map<K,V> |
getCache()
Get the cache instance. |
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. |
boolean |
isEmpty()
|
Set<K> |
keySet()
|
V |
put(K key,
V value)
|
void |
putAll(Map<? extends K,? extends V> map)
|
V |
remove(Object key)
|
protected void |
setCache(Map<K,V> cache)
Set the cache instance. |
int |
size()
|
Collection<V> |
values()
|
| Methods inherited from class org.castor.cache.AbstractBaseCache |
|---|
close, expire, expireAll, getName, initialize |
| 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, hashCode |
| Constructor Detail |
|---|
public AbstractDistributedCache()
| Method Detail |
|---|
protected final Map<K,V> getCache()
protected final void setCache(Map<K,V> cache)
cache - The cache instance.public int size()
public boolean isEmpty()
public boolean containsKey(Object key)
public boolean containsValue(Object value)
public V get(Object key)
public V put(K key,
V value)
public V remove(Object key)
public void putAll(Map<? extends K,? extends V> map)
public void clear()
public Set<K> keySet()
public Collection<V> values()
public Set<Map.Entry<K,V>> entrySet()
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 | |||||||||