org.apache.jcs.engine.behavior
Interface ICacheServiceNonLocal

All Superinterfaces:
ICacheService, Remote
All Known Subinterfaces:
ILateralCacheService, IRemoteCacheService, IRemoteHttpCacheClient
All Known Implementing Classes:
AbstractRemoteCacheService, LateralTCPService, RemoteHttpCacheClient, RemoteHttpCacheService, ZombieCacheServiceNonLocal, ZombieLateralCacheService, ZombieRemoteCacheService

public interface ICacheServiceNonLocal
extends Remote, ICacheService

Used to retrieve and update non local caches, such as the remote and lateral caches. Unlike ICacheService, the methods here have a requester id. This allows us to avoid propagating events to ourself.

TODO consider not extending ICacheService


Method Summary
 ICacheElement get(String cacheName, Serializable key, long requesterId)
          Returns a cache bean from the specified cache; or null if the key does not exist.
 Set getGroupKeys(String cacheName, String groupName)
          Likely not implemented.
 Map getMatching(String cacheName, String pattern, long requesterId)
          Gets multiple items from the cache matching the pattern.
 Map getMultiple(String cacheName, Set keys, long requesterId)
          Gets multiple items from the cache based on the given set of keys.
 void remove(String cacheName, Serializable key, long requesterId)
          Removes the given key from the specified cache.
 void removeAll(String cacheName, long requesterId)
          Remove all keys from the specified cache.
 void update(ICacheElement item, long requesterId)
          Puts a cache item to the cache.
 
Methods inherited from interface org.apache.jcs.engine.behavior.ICacheService
dispose, get, getMatching, getMultiple, release, remove, removeAll, update
 

Method Detail

update

void update(ICacheElement item,
            long requesterId)
            throws IOException
Puts a cache item to the cache.

Parameters:
item -
requesterId -
Throws:
IOException

remove

void remove(String cacheName,
            Serializable key,
            long requesterId)
            throws IOException
Removes the given key from the specified cache.

Parameters:
cacheName -
key -
requesterId -
Throws:
IOException

removeAll

void removeAll(String cacheName,
               long requesterId)
               throws IOException
Remove all keys from the specified cache.

Parameters:
cacheName -
requesterId -
Throws:
IOException

get

ICacheElement get(String cacheName,
                  Serializable key,
                  long requesterId)
                  throws IOException
Returns a cache bean from the specified cache; or null if the key does not exist.

Adding the requestor id, allows the cache to determine the sournce of the get.

Parameters:
cacheName -
key -
requesterId -
Returns:
ICacheElement
Throws:
IOException

getMultiple

Map getMultiple(String cacheName,
                Set keys,
                long requesterId)
                throws IOException
Gets multiple items from the cache based on the given set of keys.

Parameters:
cacheName -
keys -
requesterId -
Returns:
a map of Serializable key to ICacheElement element, or an empty map if there is no data in cache for any of these keys
Throws:
IOException

getMatching

Map getMatching(String cacheName,
                String pattern,
                long requesterId)
                throws IOException
Gets multiple items from the cache matching the pattern.

Parameters:
cacheName -
pattern -
requesterId -
Returns:
a map of Serializable key to ICacheElement element, or an empty map if there is no data in cache matching the pattern.
Throws:
IOException

getGroupKeys

Set getGroupKeys(String cacheName,
                 String groupName)
                 throws IOException
Likely not implemented. This probably should be deprecated.

Parameters:
cacheName -
groupName -
Returns:
A Set of keys
Throws:
IOException


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