org.apache.jcs.engine
Class CacheWatchRepairable

java.lang.Object
  extended by org.apache.jcs.engine.CacheWatchRepairable
All Implemented Interfaces:
ICacheObserver
Direct Known Subclasses:
LateralCacheWatchRepairable, RemoteCacheWatchRepairable

public class CacheWatchRepairable
extends Object
implements ICacheObserver

Intercepts the requests to the underlying ICacheObserver object so that the listeners can be recorded locally for remote connection recovery purposes. (Durable subscription like those in JMS is not implemented at this stage for it can be too expensive.)


Constructor Summary
CacheWatchRepairable()
           
 
Method Summary
<K extends Serializable,V extends Serializable>
void
addCacheListener(ICacheListener<K,V> obj)
          Adds a feature to the CacheListener attribute of the CacheWatchRepairable object
<K extends Serializable,V extends Serializable>
void
addCacheListener(String cacheName, ICacheListener<K,V> obj)
          Adds a feature to the CacheListener attribute of the CacheWatchRepairable object
<K extends Serializable,V extends Serializable>
void
removeCacheListener(ICacheListener<K,V> obj)
          Unsubscribes from all caches.
<K extends Serializable,V extends Serializable>
void
removeCacheListener(String cacheName, ICacheListener<K,V> obj)
          Tell the server to release us.
 void setCacheWatch(ICacheObserver cacheWatch)
          Replaces the underlying cache watch service and reattached all existing listeners to the new cache watch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheWatchRepairable

public CacheWatchRepairable()
Method Detail

setCacheWatch

public void setCacheWatch(ICacheObserver cacheWatch)
Replaces the underlying cache watch service and reattached all existing listeners to the new cache watch.

Parameters:
cacheWatch - The new cacheWatch value

addCacheListener

public <K extends Serializable,V extends Serializable> void addCacheListener(String cacheName,
                                                                             ICacheListener<K,V> obj)
                      throws IOException
Adds a feature to the CacheListener attribute of the CacheWatchRepairable object

Specified by:
addCacheListener in interface ICacheObserver
Parameters:
cacheName - The feature to be added to the CacheListener attribute
obj - The feature to be added to the CacheListener attribute
Throws:
IOException

addCacheListener

public <K extends Serializable,V extends Serializable> void addCacheListener(ICacheListener<K,V> obj)
                      throws IOException
Adds a feature to the CacheListener attribute of the CacheWatchRepairable object

Specified by:
addCacheListener in interface ICacheObserver
Parameters:
obj - The feature to be added to the CacheListener attribute
Throws:
IOException

removeCacheListener

public <K extends Serializable,V extends Serializable> void removeCacheListener(String cacheName,
                                                                                ICacheListener<K,V> obj)
                         throws IOException
Tell the server to release us.

Specified by:
removeCacheListener in interface ICacheObserver
Parameters:
cacheName -
obj -
Throws:
IOException

removeCacheListener

public <K extends Serializable,V extends Serializable> void removeCacheListener(ICacheListener<K,V> obj)
                         throws IOException
Description copied from interface: ICacheObserver
Unsubscribes from all caches.

Specified by:
removeCacheListener in interface ICacheObserver
Parameters:
obj -
Throws:
IOException


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