de.smartics.properties.spi.config.cache
Class InMemoryCacheManager

Package class diagram package InMemoryCacheManager
java.lang.Object
  extended by de.smartics.properties.spi.config.cache.InMemoryCacheManager
All Implemented Interfaces:
CacheManager

@ThreadSafe
public final class InMemoryCacheManager
     
     
extends Object
implements CacheManager

The cache manager implementation to store caches in-memory.


Constructor Summary
InMemoryCacheManager()
          Default constructor.
 
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 cache with the given name.
 UnawareCache<?,?> getPropertiesCache(String cacheName)
          Returns the 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InMemoryCacheManager

public InMemoryCacheManager()
Default constructor.

Method Detail

clearAll

public void clearAll()
Removes all keys from all caches.

Specified by:
clearAll in interface CacheManager

clear

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

Specified by:
clear in interface CacheManager
Parameters:
cacheName - the name of the cache to be cleared.

discard

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

Specified by:
discard in interface CacheManager
Parameters:
cacheName - the name of the cache to be cleared and stopped.

stopAll

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

Specified by:
stopAll in interface CacheManager

stop

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

Specified by:
stop in interface CacheManager
Parameters:
cacheName - the name of the cache to stop.

getPropertiesCache

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

Specified by:
getPropertiesCache in interface CacheManager
Parameters:
cacheName - the name of the cache to fetch.
Returns:
the requested cache already started.

getConfigurationsCache

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

Specified by:
getConfigurationsCache in interface CacheManager
Parameters:
cacheName - the name of the cache to fetch.
Returns:
the requested cache already started.

getCacheNames

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

Specified by:
getCacheNames in interface CacheManager
Returns:
the set of cache names.


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