com.oroad.stxx.cache
Class CacheManagerImpl

java.lang.Object
  extended bycom.oroad.stxx.cache.CacheManagerImpl
All Implemented Interfaces:
CacheManager

public final class CacheManagerImpl
extends java.lang.Object
implements CacheManager

The default implementation of CacheManager implemented as a singleton

Author:
Don Brown

Field Summary
 
Fields inherited from interface com.oroad.stxx.cache.CacheManager
DEFAULT_CACHE_CLASS
 
Method Summary
 void addCache(Cache cache)
          Adds a cache
 void clearCaches()
          Clears all caches
 void destroy()
          Stops the expiration and clears the cache
static void enableExpiration(boolean val)
          Enables or disable expiration
 Cache getCache(java.lang.String cacheName)
          Gets the cache
static CacheManager getInstance()
          Gets a reference to the only instance of the class
 void removeCache(java.lang.String cacheName)
          Removes a cache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CacheManager getInstance()
Gets a reference to the only instance of the class

Returns:
The instance value

enableExpiration

public static void enableExpiration(boolean val)
Enables or disable expiration

Parameters:
val - If true, enable expiration

destroy

public void destroy()
Stops the expiration and clears the cache

Specified by:
destroy in interface CacheManager

getCache

public Cache getCache(java.lang.String cacheName)
Gets the cache

Specified by:
getCache in interface CacheManager
Parameters:
cacheName - The name of the cache to retrieve
Returns:
The cache value

addCache

public void addCache(Cache cache)
Adds a cache

Specified by:
addCache in interface CacheManager
Parameters:
cache - The cache to add

removeCache

public void removeCache(java.lang.String cacheName)
Removes a cache

Specified by:
removeCache in interface CacheManager
Parameters:
cacheName - The name of the cache to remove

clearCaches

public void clearCaches()
Clears all caches

Specified by:
clearCaches in interface CacheManager