org.apache.jcs.auxiliary.disk
Class AbstractDiskCache.MyCacheListener

java.lang.Object
  extended byorg.apache.jcs.auxiliary.disk.AbstractDiskCache.MyCacheListener
All Implemented Interfaces:
ICacheListener
Enclosing class:
AbstractDiskCache

private class AbstractDiskCache.MyCacheListener
extends java.lang.Object
implements ICacheListener

Cache that implements the CacheListener interface, and calls appropriate methods in its parent class.


Field Summary
private  byte listenerId
           
 
Constructor Summary
private AbstractDiskCache.MyCacheListener()
           
 
Method Summary
 byte getListenerId()
          Gets the listenerId attribute of the ICacheListener object
 void handleDispose(java.lang.String cacheName)
          Notifies the subscribers for freeing up the named cache.
 void handlePut(ICacheElement element)
          Notifies the subscribers for a cache entry update.
 void handleRemove(java.lang.String cacheName, java.io.Serializable key)
          Notifies the subscribers for a cache entry removal.
 void handleRemoveAll(java.lang.String cacheName)
          Notifies the subscribers for a cache remove-all.
 void setListenerId(byte id)
          sets unique identifier of listener home
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerId

private byte listenerId
Constructor Detail

AbstractDiskCache.MyCacheListener

private AbstractDiskCache.MyCacheListener()
Method Detail

getListenerId

public byte getListenerId()
                   throws java.io.IOException
Description copied from interface: ICacheListener
Gets the listenerId attribute of the ICacheListener object

Specified by:
getListenerId in interface ICacheListener
Returns:
The listenerId value
Throws:
java.io.IOException
See Also:
ICacheListener.getListenerId()

setListenerId

public void setListenerId(byte id)
                   throws java.io.IOException
Description copied from interface: ICacheListener
sets unique identifier of listener home

Specified by:
setListenerId in interface ICacheListener
Parameters:
id - The new listenerId value
Throws:
java.io.IOException
See Also:
ICacheListener.setListenerId(byte)

handlePut

public void handlePut(ICacheElement element)
               throws java.io.IOException
Description copied from interface: ICacheListener
Notifies the subscribers for a cache entry update.

Specified by:
handlePut in interface ICacheListener
Throws:
java.io.IOException
See Also:
NOTE: This checks if the element is a puratory element and behaves differently depending. However since we have control over how elements are added to the cache event queue, that may not be needed ( they are always PurgatoryElements ).

handleRemove

public void handleRemove(java.lang.String cacheName,
                         java.io.Serializable key)
                  throws java.io.IOException
Description copied from interface: ICacheListener
Notifies the subscribers for a cache entry removal.

Specified by:
handleRemove in interface ICacheListener
Throws:
java.io.IOException
See Also:
ICacheListener.handleRemove(java.lang.String, java.io.Serializable)

handleRemoveAll

public void handleRemoveAll(java.lang.String cacheName)
                     throws java.io.IOException
Description copied from interface: ICacheListener
Notifies the subscribers for a cache remove-all.

Specified by:
handleRemoveAll in interface ICacheListener
Throws:
java.io.IOException
See Also:
ICacheListener.handleRemoveAll(java.lang.String)

handleDispose

public void handleDispose(java.lang.String cacheName)
                   throws java.io.IOException
Description copied from interface: ICacheListener
Notifies the subscribers for freeing up the named cache.

Specified by:
handleDispose in interface ICacheListener
Throws:
java.io.IOException
See Also:
ICacheListener.handleDispose(java.lang.String)