01: package ri.cache;
02:
03: import javax.cache.CacheManager;
04: import javax.cache.CacheException;
05: import javax.cache.Cache;
06:
07: /**
08: * ReferenceCacheManager
09: *
10: * @author Brian Goetz
11: */
12: public class ReferenceCacheManager extends AbstractCacheManager
13: implements CacheManager {
14:
15: public ReferenceCacheManager(String uri) throws CacheException {
16: super (uri);
17: // @@@ Parse URI
18: // @@@ Load configuration
19: // @@@ Instantiate each defined cache?
20: // @@@ Compute canonical identifier for URI
21: transitionState(State.STARTING, State.RUNNING);
22: }
23:
24: public void newCache(String cacheName) throws CacheException {
25:
26: }
27:
28: public void shutdown() {
29: State curState = state.get();
30: if (curState == State.STOPPING || curState == State.TERMINATED)
31: return;
32: transitionState(curState, State.STOPPING);
33:
34: for (String name : getCacheNames()) {
35: Cache c = getCache(name);
36: unregisterCache(name);
37: c.shutdown();
38: }
39:
40: transitionState(State.STOPPING, State.TERMINATED);
41: }
42: }
|