public class MethodResultCache extends Object
Modifier | Constructor and Description |
---|---|
protected |
MethodResultCache()
Allows subclasses to have ctors that do not require a cache.
|
|
MethodResultCache(org.apache.commons.jcs.access.GroupCacheAccess<MethodCacheKey,Object> cache)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the cache
|
<T> T |
get(Serializable instanceOrClass,
String method,
Serializable... arg)
Get an object from the method cache
|
protected Object |
getImpl(MethodCacheKey key) |
<T> void |
put(T value,
Serializable instanceOrClass,
String method,
Serializable... arg)
Put an object into the method cache
|
protected Object |
putImpl(MethodCacheKey key,
Object value) |
<T> T |
remove(Serializable instanceOrClass,
String method,
Serializable... arg)
Remove object from method cache
|
void |
removeAll(Serializable instanceOrClass,
String method)
Remove all objects of the same group
|
protected Object |
removeImpl(MethodCacheKey key) |
public MethodResultCache(org.apache.commons.jcs.access.GroupCacheAccess<MethodCacheKey,Object> cache)
cache
- the cache instance to useprotected MethodResultCache()
public void clear()
protected Object getImpl(MethodCacheKey key)
protected Object putImpl(MethodCacheKey key, Object value) throws TorqueException
TorqueException
protected Object removeImpl(MethodCacheKey key)
public <T> T get(Serializable instanceOrClass, String method, Serializable... arg)
T
- type of the instance classinstanceOrClass
- the Object on which the method is invoked. if
the method is static, a String representing the class name is used.method
- the method namearg
- optional arguments for the methodpublic <T> void put(T value, Serializable instanceOrClass, String method, Serializable... arg)
T
- type of the instance classvalue
- the object to put into the cacheinstanceOrClass
- the Object on which the method is invoked. if
the method is static, a String representing the class name is used.method
- the method namearg
- optional arguments for the methodpublic void removeAll(Serializable instanceOrClass, String method)
instanceOrClass
- the Object on which the method is invoked. if
the method is static, a String representing the class name is used.method
- the method namepublic <T> T remove(Serializable instanceOrClass, String method, Serializable... arg)
T
- type of the instance classinstanceOrClass
- the Object on which the method is invoked. if
the method is static, a String representing the class name is used.method
- the method namearg
- optional arguments for the methodCopyright © 2000–2020 The Apache Software Foundation. All rights reserved.