Package org.apache.torque.manager
Klasse MethodResultCache
java.lang.Object
org.apache.torque.manager.MethodResultCache
- Bekannte direkte Unterklassen:
NoOpMethodResultCache
This class provides a cache for convenient storage of method
results.
- Version:
- $Id: MethodResultCache.java 1917233 2024-04-21 11:37:11Z tv $
- Autor:
- John McNally
-
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungprotected
Allows subclasses to have ctors that do not require a cache.MethodResultCache
(org.apache.commons.jcs3.access.GroupCacheAccess<MethodCacheKey, Object> cache) Constructor -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
clear()
Clear the cache<T> T
get
(Serializable instanceOrClass, String method, Serializable... arg) Get an object from the method cacheprotected Object
getImpl
(MethodCacheKey key) <T> void
put
(T value, Serializable instanceOrClass, String method, Serializable... arg) Put an object into the method cacheprotected Object
putImpl
(MethodCacheKey key, Object value) <T> T
remove
(Serializable instanceOrClass, String method, Serializable... arg) Remove object from method cachevoid
removeAll
(Serializable instanceOrClass, String method) Remove all objects of the same groupprotected Object
removeImpl
(MethodCacheKey key)
-
Konstruktordetails
-
MethodResultCache
public MethodResultCache(org.apache.commons.jcs3.access.GroupCacheAccess<MethodCacheKey, Object> cache) Constructor- Parameter:
cache
- the cache instance to use
-
MethodResultCache
protected MethodResultCache()Allows subclasses to have ctors that do not require a cache. This is used by NullMethodResultCache which has no-op versions of all methods.
-
-
Methodendetails
-
clear
public void clear()Clear the cache -
getImpl
-
putImpl
- Löst aus:
TorqueException
-
removeImpl
-
get
Get an object from the method cache- Typparameter:
T
- type of the instance class- Parameter:
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 namearg
- optional arguments for the method- Gibt zurück:
- the object or null if it does not exist
-
put
Put an object into the method cache- Typparameter:
T
- type of the instance class- Parameter:
value
- 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 method
-
removeAll
Remove all objects of the same group- Parameter:
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 name
-
remove
Remove object from method cache- Typparameter:
T
- type of the instance class- Parameter:
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 namearg
- optional arguments for the method- Gibt zurück:
- the removed object
-