org.apache.jcs.engine.behavior
Interface ICacheService

All Known Subinterfaces:
ICacheServiceNonLocal, ILateralCacheService, IRemoteCacheService, IRemoteHttpCacheClient
All Known Implementing Classes:
AbstractRemoteCacheService, LateralTCPService, RemoteHttpCacheClient, RemoteHttpCacheService, ZombieCacheService, ZombieCacheServiceNonLocal, ZombieLateralCacheService, ZombieRemoteCacheService

public interface ICacheService

Used to retrieve and update the cache.

Note: server which implements this interface provides a local cache service, whereas server which implements IRmiCacheService provides a remote cache service.


Method Summary
 void dispose(String cacheName)
          Frees the specified cache.
 ICacheElement get(String cacheName, Serializable key)
          Returns a cache bean from the specified cache; or null if the key does not exist.
 Map getMatching(String cacheName, String pattern)
          Gets multiple items from the cache matching the pattern.
 Map getMultiple(String cacheName, Set keys)
          Gets multiple items from the cache based on the given set of keys.
 void release()
          Frees all caches.
 void remove(String cacheName, Serializable key)
          Removes the given key from the specified cache.
 void removeAll(String cacheName)
          Remove all keys from the sepcified cache.
 void update(ICacheElement item)
          Puts a cache item to the cache.
 

Method Detail

update

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

Parameters:
item -
Throws:
ObjectExistsException
IOException

get

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

Parameters:
cacheName -
key -
Returns:
the ICacheElement or null if not found
Throws:
ObjectNotFoundException
IOException

getMultiple

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

Parameters:
cacheName -
keys -
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:
ObjectNotFoundException
IOException

getMatching

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

Parameters:
cacheName -
pattern -
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

remove

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

Parameters:
cacheName -
key -
Throws:
IOException

removeAll

void removeAll(String cacheName)
               throws IOException
Remove all keys from the sepcified cache.

Parameters:
cacheName -
Throws:
IOException

dispose

void dispose(String cacheName)
             throws IOException
Frees the specified cache.

Parameters:
cacheName -
Throws:
IOException

release

void release()
             throws IOException
Frees all caches.

Throws:
IOException


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