org.figure8.join.services.cache
Interface CacheManager

All Known Implementing Classes:
EhCacheManager

public interface CacheManager

Interface defining a manager of 3rd level (ie. application level) caches. This allow us to later define implementations that are encapsulation of market existing Cache provider (EHCache, JBossTree, SwarmCache, ...).
Our manager only needs to have basic methods for startup, retrieval and shutdown of caches.

Version:
$Revision: 1.2 $
Author:
Laurent Broudoux

Method Summary
 void clearCaches()
          Clear (ie. flush) all managed caches.
 void createCaches()
          Create all managed caches.
 Cache getCache(java.lang.String key)
          Retrieve a Cache using its key
 

Method Detail

clearCaches

void clearCaches()
                 throws CacheException
Clear (ie. flush) all managed caches. They should now be empty after this method call. If a cache cannot be cleared, best effort should be done to clear all other caches.

Throws:
CacheException - if at least one of the caches cannot be cleared

createCaches

void createCaches()
                  throws CacheException
Create all managed caches. This method should be called during Join application initialization phase. Typically, implementation shall : read its configuration, build its manager and caches (& fetch some data ?).

Throws:
CacheException - if at least one of the caches cannot be created

getCache

Cache getCache(java.lang.String key)
Retrieve a Cache using its key

Parameters:
key - The key within is store the cache into the manager
Returns:
The retrieved Cache or null if there's no corresponding cache


Copyright © 2005-2008 Join. All Rights Reserved.