org.apache.jcs.engine
Class CacheAdaptor<K extends Serializable,V extends Serializable>

java.lang.Object
  extended by org.apache.jcs.engine.CacheAdaptor<K,V>
All Implemented Interfaces:
ICacheListener<K,V>

public class CacheAdaptor<K extends Serializable,V extends Serializable>
extends Object
implements ICacheListener<K,V>

Used for Cache-to-Cache messaging purposes. These are used in the balking facades in the lateral and remote caches.


Field Summary
protected  long listenerId
          The unique id of this listener.
 
Constructor Summary
CacheAdaptor(ICache<K,V> cache)
          Constructor for the CacheAdaptor object
 
Method Summary
 long getListenerId()
          Gets the listenerId attribute of the CacheAdaptor object
 void handleDispose(String cacheName)
          Shutdown call.
 void handlePut(ICacheElement<K,V> item)
          Puts an item into the cache.
 void handleRemove(String cacheName, K key)
          Removes an item.
 void handleRemoveAll(String cacheName)
          Clears the region.
 void setListenerId(long id)
          Sets the listenerId attribute of the CacheAdaptor object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerId

protected long listenerId
The unique id of this listener.

Constructor Detail

CacheAdaptor

public CacheAdaptor(ICache<K,V> cache)
Constructor for the CacheAdaptor object

Parameters:
cache -
Method Detail

setListenerId

public void setListenerId(long id)
                   throws IOException
Sets the listenerId attribute of the CacheAdaptor object

Specified by:
setListenerId in interface ICacheListener<K extends Serializable,V extends Serializable>
Parameters:
id - The new listenerId value
Throws:
IOException

getListenerId

public long getListenerId()
                   throws IOException
Gets the listenerId attribute of the CacheAdaptor object

Specified by:
getListenerId in interface ICacheListener<K extends Serializable,V extends Serializable>
Returns:
The listenerId value
Throws:
IOException

handlePut

public void handlePut(ICacheElement<K,V> item)
               throws IOException
Puts an item into the cache.

Specified by:
handlePut in interface ICacheListener<K extends Serializable,V extends Serializable>
Parameters:
item -
Throws:
IOException

handleRemove

public void handleRemove(String cacheName,
                         K key)
                  throws IOException
Removes an item.

Specified by:
handleRemove in interface ICacheListener<K extends Serializable,V extends Serializable>
Parameters:
cacheName -
key -
Throws:
IOException

handleRemoveAll

public void handleRemoveAll(String cacheName)
                     throws IOException
Clears the region.

Specified by:
handleRemoveAll in interface ICacheListener<K extends Serializable,V extends Serializable>
Parameters:
cacheName -
Throws:
IOException

handleDispose

public void handleDispose(String cacheName)
                   throws IOException
Shutdown call.

Specified by:
handleDispose in interface ICacheListener<K extends Serializable,V extends Serializable>
Parameters:
cacheName -
Throws:
IOException


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.