Package org.apache.commons.jcs3.engine
Class ZombieCacheServiceNonLocal<K,V>
java.lang.Object
org.apache.commons.jcs3.engine.ZombieCacheService<K,V>
org.apache.commons.jcs3.engine.ZombieCacheServiceNonLocal<K,V>
- All Implemented Interfaces:
Remote
,ICacheService<K,
,V> ICacheServiceNonLocal<K,
,V> IZombie
public class ZombieCacheServiceNonLocal<K,V>
extends ZombieCacheService<K,V>
implements ICacheServiceNonLocal<K,V>
Zombie adapter for the non local cache services. It just balks if there is no queue configured.
If a queue is configured, then events will be added to the queue. The idea is that when proper operation is restored, the non local cache will walk the queue. The queue must be bounded so it does not eat memory.
This originated in the remote cache.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Base of the other events. -
Constructor Summary
ConstructorDescriptionDefault.ZombieCacheServiceNonLocal
(int maxQueueSize) Sets the maximum number of items that will be allowed on the queue. -
Method Summary
Modifier and TypeMethodDescriptionDoes nothing.Does nothing.Map<K,
ICacheElement<K, V>> getMatching
(String cacheName, String pattern, long requesterId) Does nothing.Map<K,
ICacheElement<K, V>> getMultiple
(String cacheName, Set<K> keys, long requesterId) Gets multiple items from the cache based on the given set of keys.int
Gets the number of items on the queue.void
propagateEvents
(ICacheServiceNonLocal<K, V> service) Walk the queue, calling the service for each queue operation.void
Adds a removeAll event to the queue if the maxSize is greater than 0;void
Adds a removeAll event to the queue if the maxSize is greater than 0;void
update
(ICacheElement<K, V> item, long listenerId) Adds an update event to the queue if the maxSize is greater than 0;Methods inherited from class org.apache.commons.jcs3.engine.ZombieCacheService
dispose, get, get, getMatching, getMultiple, put, release, remove, removeAll, update
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.commons.jcs3.engine.behavior.ICacheService
dispose, get, getMatching, getMultiple, release, remove, removeAll, update
-
Constructor Details
-
ZombieCacheServiceNonLocal
public ZombieCacheServiceNonLocal()Default. -
ZombieCacheServiceNonLocal
Sets the maximum number of items that will be allowed on the queue.- Parameters:
maxQueueSize
-
-
-
Method Details
-
getQueueSize
Gets the number of items on the queue.- Returns:
- size of the queue.
-
update
Adds an update event to the queue if the maxSize is greater than 0;- Specified by:
update
in interfaceICacheServiceNonLocal<K,
V> - Parameters:
item
- ICacheElementlistenerId
- - identifies the caller.
-
remove
Adds a removeAll event to the queue if the maxSize is greater than 0;- Specified by:
remove
in interfaceICacheServiceNonLocal<K,
V> - Parameters:
cacheName
- - region namekey
- - item keylistenerId
- - identifies the caller.
-
removeAll
Adds a removeAll event to the queue if the maxSize is greater than 0;- Specified by:
removeAll
in interfaceICacheServiceNonLocal<K,
V> - Parameters:
cacheName
- - name of the regionlistenerId
- - identifies the caller.
-
get
Does nothing. Gets are synchronous and cannot be added to a queue.- Specified by:
get
in interfaceICacheServiceNonLocal<K,
V> - Parameters:
cacheName
- - region namekey
- - item keyrequesterId
- - identifies the caller.- Returns:
- null
- Throws:
IOException
-
getMatching
public Map<K,ICacheElement<K, getMatchingV>> (String cacheName, String pattern, long requesterId) throws IOException Does nothing.- Specified by:
getMatching
in interfaceICacheServiceNonLocal<K,
V> - Parameters:
cacheName
-pattern
-requesterId
-- Returns:
- empty map
- Throws:
IOException
-
getMultiple
Description copied from interface:ICacheServiceNonLocal
Gets multiple items from the cache based on the given set of keys.- Specified by:
getMultiple
in interfaceICacheServiceNonLocal<K,
V> - Parameters:
cacheName
- - region namekeys
- - item keyrequesterId
- - identity of the caller- Returns:
- an empty map. zombies have no internal data
-
getKeySet
Does nothing.- Specified by:
getKeySet
in interfaceICacheServiceNonLocal<K,
V> - Parameters:
cacheName
- - region name- Returns:
- empty set
-
propagateEvents
Walk the queue, calling the service for each queue operation.- Parameters:
service
-- Throws:
Exception
-