org.jtools.cache
Class CacheManager

java.lang.Object
  extended byorg.jtools.cache.CacheManager

public class CacheManager
extends java.lang.Object

 Cache Manager
 

Version:
$Id: CacheManager.java,v 1.3 2002/08/07 16:51:09 stfndln Exp $
Author:
Stefaan Delanghe (stfndln@yahoo.com)

Field Summary
protected static java.util.HashMap hsmCache
          hashmap that holds all the cached objects
protected static int intThreadSleep
          The time the thread goes to sleep
protected static java.util.Iterator keys
          object for looping of all the keys
protected static java.util.Set keySet
          holds all the keys of all the cached objects
 
Constructor Summary
CacheManager()
           
 
Method Summary
static boolean containsKey(java.lang.Object p_key)
          checks if the cache has a specified identifier
static Cacheable getCacheObject(java.lang.Object p_id)
          retrieves a cached object by his identifier.
static void setCacheObject(Cacheable p_object)
          puts an object in the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hsmCache

protected static java.util.HashMap hsmCache
hashmap that holds all the cached objects


intThreadSleep

protected static int intThreadSleep
The time the thread goes to sleep


keySet

protected static java.util.Set keySet
holds all the keys of all the cached objects


keys

protected static java.util.Iterator keys
object for looping of all the keys

Constructor Detail

CacheManager

public CacheManager()
Method Detail

setCacheObject

public static void setCacheObject(Cacheable p_object)
puts an object in the cache.

Parameters:
p_object - Object Object to put in the cache

getCacheObject

public static Cacheable getCacheObject(java.lang.Object p_id)
retrieves a cached object by his identifier.

Parameters:
p_id - Object Identifier of the object
Returns:
Object Cached object

containsKey

public static boolean containsKey(java.lang.Object p_key)
checks if the cache has a specified identifier

Parameters:
p_key - Object The identifier to check
Returns:
boolean if identifier is in the cache returns true otherwise returns false