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

Package class diagram package CacheManagerFactory
java.lang.Object
  extended by de.smartics.properties.resource.util.AbstractServiceFactory<CacheManager>
      extended by de.smartics.properties.spi.config.cache.CacheManagerFactory

public final class CacheManagerFactory
     
     
extends AbstractServiceFactory< CacheManager>

Creates instances of the CacheManager.

Returns the manager for caches. The manager class is registered in META-INF/services/de.smartics.properties.spi.config.cache.CacheManager .

Issues a warning if more than one implementation is found. Returns an instance of the first implementation found. If no type is specified, returns an instance of AmnesiaCacheManager per default.


Method Summary
static void clear(String cacheName)
          Clears the cache with the given name.
static void clearAll()
          Removes all keys from all caches.
static void discard(String cacheName)
          Clears and stops the cache.
static Set<String> getCacheNames()
          Returns the set of cache names.
static Cache<?,?> getConfigurationsCache(String cacheName)
          Returns the cache with the given name.
static CacheManager getManager()
          Returns the instance of the manager.
static UnawareCache<?,?> getPropertiesCache(String cacheName)
          Returns the cache with the given name.
static void stop(String cacheName)
          Stops the cache with the given name.
static void stopAll()
          Stops all caches, rendering the manager in a stopped state.
 
Methods inherited from class de.smartics.properties.resource.util.AbstractServiceFactory
create, create
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getManager

public static CacheManager getManager()
Returns the instance of the manager.

Returns:
the instance of the manager. Never null.

clearAll

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


clear

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

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

discard

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

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

stopAll

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


stop

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

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

getPropertiesCache

public static UnawareCache<?,?> getPropertiesCache(String cacheName)
Returns the 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

public static Cache<?,?> getConfigurationsCache(String cacheName)
Returns the 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

public static 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.