org.apache.jcs.engine
Class ZombieCacheServiceNonLocal

java.lang.Object
  extended by org.apache.jcs.engine.ZombieCacheService
      extended by org.apache.jcs.engine.ZombieCacheServiceNonLocal
All Implemented Interfaces:
Remote, ICacheService, ICacheServiceNonLocal, IZombie
Direct Known Subclasses:
ZombieLateralCacheService, ZombieRemoteCacheService

public class ZombieCacheServiceNonLocal
extends ZombieCacheService
implements ICacheServiceNonLocal

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.


Constructor Summary
ZombieCacheServiceNonLocal()
          Default.
ZombieCacheServiceNonLocal(int maxQueueSize)
          Sets the maximum number of items that will be allowed on the queue.
 
Method Summary
 ICacheElement get(String cacheName, Serializable key, long requesterId)
          Does nothing.
 Set getGroupKeys(String cacheName, String groupName)
          Does nothing.
 Map getMatching(String cacheName, String pattern, long requesterId)
          Does nothing.
 Map getMultiple(String cacheName, Set keys, long requesterId)
          Gets multiple items from the cache based on the given set of keys.
 int getQueueSize()
          Gets the number of items on the queue.
 void propagateEvents(ICacheServiceNonLocal service)
          Walk the queue, calling the service for each queue operation.
 void remove(String cacheName, Serializable key, long listenerId)
          Adds a removeAll event to the queue if the maxSize is greater than 0;
 void removeAll(String cacheName, long listenerId)
          Adds a removeAll event to the queue if the maxSize is greater than 0;
 void update(ICacheElement item, long listenerId)
          Adds an update event to the queue if the maxSize is greater than 0;
 
Methods inherited from class org.apache.jcs.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.jcs.engine.behavior.ICacheService
dispose, get, getMatching, getMultiple, release, remove, removeAll, update
 

Constructor Detail

ZombieCacheServiceNonLocal

public ZombieCacheServiceNonLocal()
Default.


ZombieCacheServiceNonLocal

public ZombieCacheServiceNonLocal(int maxQueueSize)
Sets the maximum number of items that will be allowed on the queue.

Parameters:
maxQueueSize -
Method Detail

getQueueSize

public int getQueueSize()
Gets the number of items on the queue.

Returns:
size of the queue.

update

public void update(ICacheElement item,
                   long listenerId)
Adds an update event to the queue if the maxSize is greater than 0;

Specified by:
update in interface ICacheServiceNonLocal
Parameters:
item - ICacheElement
listenerId - - identifies the caller.

remove

public void remove(String cacheName,
                   Serializable key,
                   long listenerId)
Adds a removeAll event to the queue if the maxSize is greater than 0;

Specified by:
remove in interface ICacheServiceNonLocal
Parameters:
cacheName - - region name
key - - item key
listenerId - - identifies the caller.

removeAll

public void removeAll(String cacheName,
                      long listenerId)
Adds a removeAll event to the queue if the maxSize is greater than 0;

Specified by:
removeAll in interface ICacheServiceNonLocal
Parameters:
cacheName - - name of the region
listenerId - - identifies the caller.

get

public ICacheElement get(String cacheName,
                         Serializable key,
                         long requesterId)
                  throws IOException
Does nothing. Gets are synchronous and cannot be added to a queue.

Specified by:
get in interface ICacheServiceNonLocal
Parameters:
cacheName - - region name
key - - item key
requesterId - - identifies the caller.
Returns:
null
Throws:
IOException

getMatching

public Map getMatching(String cacheName,
                       String pattern,
                       long requesterId)
                throws IOException
Does nothing.

Specified by:
getMatching in interface ICacheServiceNonLocal
Parameters:
cacheName -
pattern -
requesterId -
Returns:
empty map
Throws:
IOException

getMultiple

public Map getMultiple(String cacheName,
                       Set keys,
                       long requesterId)
Description copied from interface: ICacheServiceNonLocal
Gets multiple items from the cache based on the given set of keys.

Specified by:
getMultiple in interface ICacheServiceNonLocal
Parameters:
cacheName - - region name
keys - - item key
requesterId - - identity of the caller
Returns:
an empty map. zombies have no internal data

getGroupKeys

public Set getGroupKeys(String cacheName,
                        String groupName)
Does nothing.

Specified by:
getGroupKeys in interface ICacheServiceNonLocal
Parameters:
cacheName - - region name
groupName - - group name
Returns:
empty set

propagateEvents

public void propagateEvents(ICacheServiceNonLocal service)
                     throws Exception
Walk the queue, calling the service for each queue operation.

Parameters:
service -
Throws:
Exception


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