org.wanghy.cache.provider
Interface CacheProviderFacade

All Superinterfaces:
InitializingBean
All Known Implementing Classes:
AbstractCacheProviderFacadeImpl

public interface CacheProviderFacade
extends InitializingBean

Unified interface for different cache providers.

Version:
$Revision: 1.8 $ $Date: 2005/04/06 23:41:30 $
Author:
Alex Ruiz

Method Summary
 void cancelCacheUpdate(Serializable cacheKey)
          Cancels the update being made to the cache.
 void flushCache(String[] cacheProfileIds)
          Flushes the cache.
 Object getFromCache(Serializable cacheKey, String cacheProfileId)
          Retrieves an entry from the cache.
 boolean isFailQuietlyEnabled()
          Returns the value of the flag that indicates if an exception should thrown or not when an error occurrs when accessing the cache provider.
 void putInCache(Serializable cacheKey, String cacheProfileId, Object objectToCache)
          Stores an object in the cache.
 void removeFromCache(Serializable cacheKey, String cacheProfileId)
          Removes an object from the cache.
 
Methods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
 

Method Detail

cancelCacheUpdate

public void cancelCacheUpdate(Serializable cacheKey)
Cancels the update being made to the cache.

Parameters:
cacheKey - the key being used in the cache update.

flushCache

public void flushCache(String[] cacheProfileIds)
Flushes the cache.

Parameters:
cacheProfileIds - the id(s) of the cache profile(s) that specif(y/ies) what and how to flush.

getFromCache

public Object getFromCache(Serializable cacheKey,
                           String cacheProfileId)
                    throws EntryRetrievalException
Retrieves an entry from the cache.

Parameters:
cacheKey - the key under which the entry is stored.
cacheProfileId - the id of the cache profile that specifies how to retrieve an entry.
Returns:
the cached entry.
Throws:
EntryRetrievalException - if an unexpected error takes place when retrieving the entry from the cache.

isFailQuietlyEnabled

public boolean isFailQuietlyEnabled()
Returns the value of the flag that indicates if an exception should thrown or not when an error occurrs when accessing the cache provider.

Returns:
true if no exception should be thrown if an error occurrs when accessing the cache provider.

putInCache

public void putInCache(Serializable cacheKey,
                       String cacheProfileId,
                       Object objectToCache)
Stores an object in the cache.

Parameters:
cacheKey - the key under which the object will be stored.
cacheProfileId - the id of the cache profile that specifies how to store an object.
objectToCache - the object to store in the cache.

removeFromCache

public void removeFromCache(Serializable cacheKey,
                            String cacheProfileId)
Removes an object from the cache.

Parameters:
cacheKey - the key under which the object is stored.
cacheProfileId - the id of the cache profile that specifies how to store an object.


Copyright © 2004-2005 Alex Ruiz. All Rights Reserved.