com.rhi.architecture.cache.simple
Class SimpleCacheFactory

java.lang.Object
  extended bycom.rhi.architecture.cache.simple.SimpleCacheFactory
All Implemented Interfaces:
CacheFactory, Resource

public class SimpleCacheFactory
extends java.lang.Object
implements CacheFactory

CacheFactory class manages caching creation/retrieval of specific cache mgr. This class uses simple HashMap to store cacheable objects. It is a resource class hence has it will be registered into the the ResourceContext and in the init method it initilizes all the CacheManagers and its respective caches.

Since:
1.0
Author:
G Srinivas

Field Summary
 
Fields inherited from interface com.rhi.architecture.cache.CacheFactory
KEY
 
Constructor Summary
SimpleCacheFactory()
          Constructor
 
Method Summary
 void close()
          As part of Resource object it cleans up the CacheManagers which inturn will make cached data garbage collected.
 CacheManager getManager(java.lang.Object className)
          Retrieves the CacheManager that is specific to the className object.
 void init(java.util.Properties p)
          This init method will be called while Resources are being registered and initilised.
protected static Logger log()
          convenience method to retrieve logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleCacheFactory

public SimpleCacheFactory()
Constructor

Since:
1.0
Method Detail

log

protected static Logger log()
convenience method to retrieve logger.

Returns:

init

public void init(java.util.Properties p)
          throws InitializationException
This init method will be called while Resources are being registered and initilised. It obtains all the cacheable objects class names and calls load on it to load cache in the CacheManagers.

Specified by:
init in interface Resource
Parameters:
p -
Throws:
InitializationException

getManager

public CacheManager getManager(java.lang.Object className)
Retrieves the CacheManager that is specific to the className object.

Specified by:
getManager in interface CacheFactory
Parameters:
className -
Returns:
CacheManager

close

public void close()
As part of Resource object it cleans up the CacheManagers which inturn will make cached data garbage collected.

Specified by:
close in interface Resource


Copyright © 2002-2004 Robert Half International. All Rights Reserved.