Package org.apache.torque.manager
Class NoOpMethodResultCache
- java.lang.Object
-
- org.apache.torque.manager.MethodResultCache
-
- org.apache.torque.manager.NoOpMethodResultCache
-
public class NoOpMethodResultCache extends MethodResultCache
This class provides a no-op cache for convenient storage of method results- Version:
- $Id: NoOpMethodResultCache.java 1839288 2018-08-27 09:48:33Z tv $
- Author:
- John McNally
-
-
Constructor Summary
Constructors Constructor Description NoOpMethodResultCache(org.apache.commons.jcs.access.GroupCacheAccess<MethodCacheKey,Object> cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear the cache<T> Tget(Serializable instanceOrClass, String method, Serializable... arg)Get an object from the method cacheprotected ObjectgetImpl(MethodCacheKey key)<T> voidput(T value, Serializable instanceOrClass, String method, Serializable... arg)Put an object into the method cacheprotected ObjectputImpl(MethodCacheKey key, Object value)<T> Tremove(Serializable instanceOrClass, String method, Serializable... arg)Remove object from method cachevoidremoveAll(Serializable instanceOrClass, String method)Remove all objects of the same groupprotected ObjectremoveImpl(MethodCacheKey key)
-
-
-
Constructor Detail
-
NoOpMethodResultCache
public NoOpMethodResultCache(org.apache.commons.jcs.access.GroupCacheAccess<MethodCacheKey,Object> cache)
-
-
Method Detail
-
clear
public void clear()
Clear the cache- Overrides:
clearin classMethodResultCache
-
getImpl
protected Object getImpl(MethodCacheKey key)
- Overrides:
getImplin classMethodResultCache- See Also:
MethodResultCache.getImpl(org.apache.torque.manager.MethodCacheKey)
-
putImpl
protected Object putImpl(MethodCacheKey key, Object value) throws TorqueException
- Overrides:
putImplin classMethodResultCache- Throws:
TorqueException- See Also:
MethodResultCache.putImpl(org.apache.torque.manager.MethodCacheKey, java.lang.Object)
-
removeImpl
protected Object removeImpl(MethodCacheKey key)
- Overrides:
removeImplin classMethodResultCache- See Also:
MethodResultCache.removeImpl(org.apache.torque.manager.MethodCacheKey)
-
get
public <T> T get(Serializable instanceOrClass, String method, Serializable... arg)
Description copied from class:MethodResultCacheGet an object from the method cache- Overrides:
getin classMethodResultCache- Type Parameters:
T- type of the instance class- Parameters:
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- Returns:
- the object or null if it does not exist
- See Also:
MethodResultCache.get( java.io.Serializable, java.lang.String, java.io.Serializable[])
-
put
public <T> void put(T value, Serializable instanceOrClass, String method, Serializable... arg)Description copied from class:MethodResultCachePut an object into the method cache- Overrides:
putin classMethodResultCache- Type Parameters:
T- type of the instance class- Parameters:
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- See Also:
MethodResultCache.put( java.lang.Object, java.io.Serializable, java.lang.String, java.io.Serializable[])
-
removeAll
public void removeAll(Serializable instanceOrClass, String method)
Description copied from class:MethodResultCacheRemove all objects of the same group- Overrides:
removeAllin classMethodResultCache- Parameters:
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- See Also:
MethodResultCache.removeAll(java.io.Serializable, java.lang.String)
-
remove
public <T> T remove(Serializable instanceOrClass, String method, Serializable... arg)
Description copied from class:MethodResultCacheRemove object from method cache- Overrides:
removein classMethodResultCache- Type Parameters:
T- type of the instance class- Parameters:
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- Returns:
- the removed object
- See Also:
MethodResultCache.remove(java.io.Serializable, java.lang.String, java.io.Serializable[])
-
-