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 java.lang.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
 void addCacheListener(ICacheListener obj)
          Adds a feature to the CacheListener attribute of the CacheWatchRepairable object
 void addCacheListener(java.lang.String cacheName, ICacheListener obj)
          Adds a feature to the CacheListener attribute of the CacheWatchRepairable object
 void removeCacheListener(ICacheListener obj)
          Unsubscribes from all caches.
 void removeCacheListener(java.lang.String cacheName, ICacheListener 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 void addCacheListener(java.lang.String cacheName,
                             ICacheListener obj)
                      throws java.io.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:
java.io.IOException

addCacheListener

public void addCacheListener(ICacheListener obj)
                      throws java.io.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:
java.io.IOException

removeCacheListener

public void removeCacheListener(java.lang.String cacheName,
                                ICacheListener obj)
                         throws java.io.IOException
Tell the server to release us.

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

removeCacheListener

public void removeCacheListener(ICacheListener obj)
                         throws java.io.IOException
Description copied from interface: ICacheObserver
Unsubscribes from all caches.

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


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.