Package org.apache.commons.jcs3.engine
Class CacheWatchRepairable
java.lang.Object
org.apache.commons.jcs3.engine.CacheWatchRepairable
- All Implemented Interfaces:
Remote
,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
-
Method Summary
Modifier and TypeMethodDescription<K,
V> void addCacheListener
(String cacheName, ICacheListener<K, V> obj) Adds a feature to the CacheListener attribute of the CacheWatchRepairable object<K,
V> void addCacheListener
(ICacheListener<K, V> obj) Adds a feature to the CacheListener attribute of the CacheWatchRepairable object<K,
V> void removeCacheListener
(String cacheName, ICacheListener<K, V> obj) Tell the server to release us.<K,
V> void removeCacheListener
(ICacheListener<K, V> obj) Unsubscribes from all caches.void
setCacheWatch
(ICacheObserver cacheWatch) Replaces the underlying cache watch service and re-attaches all existing listeners to the new cache watch.
-
Constructor Details
-
CacheWatchRepairable
public CacheWatchRepairable()
-
-
Method Details
-
setCacheWatch
Replaces the underlying cache watch service and re-attaches all existing listeners to the new cache watch.- Parameters:
cacheWatch
- The new cacheWatch value
-
addCacheListener
Adds a feature to the CacheListener attribute of the CacheWatchRepairable object- Specified by:
addCacheListener
in interfaceICacheObserver
- Parameters:
cacheName
- The feature to be added to the CacheListener attributeobj
- The feature to be added to the CacheListener attribute- Throws:
IOException
-
addCacheListener
Adds a feature to the CacheListener attribute of the CacheWatchRepairable object- Specified by:
addCacheListener
in interfaceICacheObserver
- Parameters:
obj
- The feature to be added to the CacheListener attribute- Throws:
IOException
-
removeCacheListener
public <K,V> void removeCacheListener(String cacheName, ICacheListener<K, V> obj) throws IOExceptionTell the server to release us.- Specified by:
removeCacheListener
in interfaceICacheObserver
- Parameters:
cacheName
-obj
-- Throws:
IOException
-
removeCacheListener
Description copied from interface:ICacheObserver
Unsubscribes from all caches.- Specified by:
removeCacheListener
in interfaceICacheObserver
- Parameters:
obj
-- Throws:
IOException
-