com.bankframe.services.cache.threadcleaned
Class ThreadCleanedCacheFactoryImpl

java.lang.Object
  extended bycom.bankframe.services.cache.CacheFactory
      extended bycom.bankframe.services.cache.threadcleaned.ThreadCleanedCacheFactoryImpl

public class ThreadCleanedCacheFactoryImpl
extends CacheFactory

This is a factory class that will create a com.bankframe.services.cache.Cache instance on demand based on the properties specified in the BankframeResource.properties file.


Nested Class Summary
static class ThreadCleanedCacheFactoryImpl.CacheCleanUpThread
          This class calls the cleanup() method on each ThreadCleanedGenericCache instance registered with the CacheFactory.
 
Constructor Summary
ThreadCleanedCacheFactoryImpl()
           
 
Method Summary
 Cache createCacheImpl(java.lang.String cacheName)
          This method creates a cache instance based on settings specified in the BankframeResource.properties file.
 Cache getCacheImpl(java.util.Map map, java.lang.String cacheName)
          Deprecated. Use getCache(String name) instead
 Cache getCacheImpl(java.lang.String cacheName)
          This method gets an instance of a cache object.
 java.util.Map getCachesImpl()
           
static boolean isCleanupDeamonRunning()
          This method determines is the cleanup thread is running
 void registerCacheImpl(java.lang.String cacheName, Cache cache)
          This registers a cache in the list of caches with the specified name
 void removeCacheImpl(java.lang.String cacheName)
          This method removes the specified cache from the system and removes all entries in the cache.
 void startCleanupDeamon()
          This method starts the cleaup deamon thread.
 void stopCleanupDeamon()
          This method starts the cleaup deamon thread.
 
Methods inherited from class com.bankframe.services.cache.CacheFactory
createCache, getCache, getCache, getCaches, getInstance, registerCache, removeCache
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadCleanedCacheFactoryImpl

public ThreadCleanedCacheFactoryImpl()
Method Detail

getCachesImpl

public java.util.Map getCachesImpl()

createCacheImpl

public Cache createCacheImpl(java.lang.String cacheName)
This method creates a cache instance based on settings specified in the BankframeResource.properties file. This method looks for a set of settings beginning with cache.cacheName where cacheName is the name of the cache.

Parameters:
cacheName -
Returns:

getCacheImpl

public Cache getCacheImpl(java.lang.String cacheName)
This method gets an instance of a cache object. This method configures the cache based on settings specified in the BankframeResource.properties file

Parameters:
cacheName - the name of this cache. This is used to distinguish distributed caches from each other.
Returns:
A cache object

registerCacheImpl

public void registerCacheImpl(java.lang.String cacheName,
                              Cache cache)
This registers a cache in the list of caches with the specified name


removeCacheImpl

public void removeCacheImpl(java.lang.String cacheName)
This method removes the specified cache from the system and removes all entries in the cache.

Parameters:
cacheName -

getCacheImpl

public Cache getCacheImpl(java.util.Map map,
                          java.lang.String cacheName)
Deprecated. Use getCache(String name) instead

This method gets an instance of a cache described in the properties file backed by a given persistent map. This method will look for the cache.distributed key in the BankFrameResource.properties file to determine if the returned cache object is distributed If the cache is distributed then the calling class should change the name of the distribued cache to ensure that it does not join the default cache

Parameters:
map - a Map object that is used as a persistent backing
cacheName - the name of this cache. This is used to distinguish distributed caches from each other
Returns:
A cache object

startCleanupDeamon

public void startCleanupDeamon()
This method starts the cleaup deamon thread. This method should be called from a application server startup class. Where the ThreadCleanedGenericCache is enabled.


stopCleanupDeamon

public void stopCleanupDeamon()
This method starts the cleaup deamon thread. This method should be called from a application server startup class. Where the ThreadCleanedGenericCache is enabled.


isCleanupDeamonRunning

public static boolean isCleanupDeamonRunning()
This method determines is the cleanup thread is running

Returns:
true is the cleanup thread is running otherwise false


Copyright © 2005, 2007, Oracle. All rights reserved.