de.smartics.properties.spi.config.cache
Interface CacheManager

Package class diagram package CacheManager
All Known Implementing Classes:
AmnesiaCacheManager, InMemoryCacheManager

public interface CacheManager

Interface to use caches. Two different kinds of caches have to be supported. One implementing UnawareCache and one implementing Cache. The reason is that we do not need to support some Methods for a properties cache, so that here the a UnawreCache implementation is sufficient. But for configurations we also need the additional method supported by Cache. Its totally legal to use the same Cache implementation for both use-cases.


Method Summary
 void clear(String cacheName)
          Clears the cache with the given name.
 void clearAll()
          Removes all keys from all caches.
 void discard(String cacheName)
          Clears and stops the cache.
 Set<String> getCacheNames()
          Returns the set of cache names.
 Cache<?,?> getConfigurationsCache(String cacheName)
          Returns the configurations cache with the given name.
 UnawareCache<?,?> getPropertiesCache(String cacheName)
          Returns the properties cache with the given name.
 void stop(String cacheName)
          Stops the cache with the given name.
 void stopAll()
          Stops all caches, rendering the manager in a stopped state.
 

Method Detail

clearAll

void clearAll()
Removes all keys from all caches.


clear

void clear(String cacheName)
Clears the cache with the given name.

Parameters:
cacheName - the name of the cache to be cleared.

discard

void discard(String cacheName)
Clears and stops the cache.

Parameters:
cacheName - the name of the cache to be cleared and stopped.

stopAll

void stopAll()
Stops all caches, rendering the manager in a stopped state.


stop

void stop(String cacheName)
Stops the cache with the given name.

Parameters:
cacheName - the name of the cache to stop.

getPropertiesCache

UnawareCache<?,?> getPropertiesCache(String cacheName)
Returns the properties cache with the given name. The cache is already started.

Parameters:
cacheName - the name of the cache to fetch.
Returns:
the requested cache already started.

getConfigurationsCache

Cache<?,?> getConfigurationsCache(String cacheName)
Returns the configurations cache with the given name. The cache is already started.

Parameters:
cacheName - the name of the cache to fetch.
Returns:
the requested cache already started.

getCacheNames

Set<String> getCacheNames()
Returns the set of cache names.

Returns:
the set of cache names.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.