com.rhi.architecture.cache.simple
Class SimpleCacheManager

java.lang.Object
  extended bycom.rhi.architecture.cache.simple.SimpleCacheManager
All Implemented Interfaces:
CacheManager

public class SimpleCacheManager
extends java.lang.Object
implements CacheManager

This is simple cache manager that handles the cacheable objects by storing and retriving from HashMap java class. Other complex cache managers can store in different java classes or third party caching mechanism like JCS etc.

Since:
1.0
Author:
G Srinivas

Field Summary
protected  java.util.HashMap cache
          This stores all the cacheable objects.
 
Constructor Summary
SimpleCacheManager(java.lang.String name)
          Constructor
 
Method Summary
 java.lang.Object get(java.lang.Object pkKey)
          This method retrieves the cacheable object from cache using the key and returns the it.
 Logger log()
           
 void put(java.lang.Object key, java.lang.Object cachedObject)
          This method adds the cacheable object to the cache with its key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected java.util.HashMap cache
This stores all the cacheable objects.

Constructor Detail

SimpleCacheManager

public SimpleCacheManager(java.lang.String name)
Constructor

Parameters:
name -
Since:
1.0
Method Detail

log

public Logger log()
Returns:
Logger to use

get

public java.lang.Object get(java.lang.Object pkKey)
This method retrieves the cacheable object from cache using the key and returns the it.

Specified by:
get in interface CacheManager
Parameters:
pkKey -
Returns:
Object

put

public void put(java.lang.Object key,
                java.lang.Object cachedObject)
         throws DuplicateObjectException
This method adds the cacheable object to the cache with its key.

Specified by:
put in interface CacheManager
Parameters:
key -
cachedObject -
Throws:
DuplicateObjectException - It throws DuplicateObjectException which is sub-class of CacheException


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