org.apache.torque.manager
Class NoOpMethodResultCache

java.lang.Object
  extended by org.apache.torque.manager.MethodResultCache
      extended by 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 1337973 2012-05-13 19:49:35Z tv $
Author:
John McNally

Constructor Summary
NoOpMethodResultCache(org.apache.jcs.access.GroupCacheAccess cache)
           
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoOpMethodResultCache

public NoOpMethodResultCache(org.apache.jcs.access.GroupCacheAccess cache)
Method Detail

clear

public void clear()
Clear the cache

Overrides:
clear in class MethodResultCache

getImpl

protected Object getImpl(MethodCacheKey key)
Overrides:
getImpl in class MethodResultCache
See Also:
MethodResultCache.getImpl(org.apache.torque.manager.MethodCacheKey)

putImpl

protected Object putImpl(MethodCacheKey key,
                         Object value)
                  throws TorqueException
Overrides:
putImpl in class MethodResultCache
Throws:
TorqueException
See Also:
MethodResultCache.putImpl(org.apache.torque.manager.MethodCacheKey, java.lang.Object)

removeImpl

protected Object removeImpl(MethodCacheKey key)
Overrides:
removeImpl in class MethodResultCache
See Also:
MethodResultCache.removeImpl(org.apache.torque.manager.MethodCacheKey)

get

public <T> T get(Serializable instanceOrClass,
                 String method,
                 Serializable... arg)
Description copied from class: MethodResultCache
Get an object from the method cache

Overrides:
get in class MethodResultCache
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
arg - 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: MethodResultCache
Put an object into the method cache

Overrides:
put in class MethodResultCache
Parameters:
value - the object to put into the cache
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
arg - 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: MethodResultCache
Remove all objects of the same group

Overrides:
removeAll in class MethodResultCache
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: MethodResultCache
Remove object from method cache

Overrides:
remove in class MethodResultCache
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
arg - optional arguments for the method
Returns:
the removed object
See Also:
MethodResultCache.remove(java.io.Serializable, java.lang.String, java.io.Serializable[])


Copyright © 2000-2012 The Apache Software Foundation. All Rights Reserved.