com.plumtree.uiinfrastructure.web
Class CachingManager

java.lang.Object
  extended by com.plumtree.uiinfrastructure.web.CachingManager

public class CachingManager
extends java.lang.Object

Title: Caching Manager

Description:

Copyright: Copyright (c) 2002

Company: Plumtree

Version:
1.0
Author:
Marc Harrison

Constructor Summary
CachingManager()
          Creates a new CachingManager object.
 
Method Summary
 void Clear()
          Remove all the elements in this cache manager.
 java.lang.Object GetEntry(java.lang.String key)
          Get an Entry from this Cache.
 IXPEnumerator GetKeys()
          An IXPEnumertor of all the keys contained in the caching manager.
 int GetMaxCount()
          Get the max number of objects that can be placed on this cache.
 int GetMaxInactiveInterval()
          Get the max inactive interval until this cache should timeout objects in the cache.
 java.lang.Object GetMostRecentlyAccessedObject()
          Get the most recently accessed Object (by set or get).
 int GetNumItems()
          Get the number of objects placed on this cache.
 long GetTimeStamp(java.lang.String key)
          Get the time stamp of an Entry from this Cache.
 void RemoveEntry(java.lang.String key)
          Remove an attribute from the caching manager.
 java.lang.String SetEntry(java.lang.Object value)
          Place an object on the cache.
 void SetEntry(java.lang.String key, java.lang.Object value)
          Place an object on the cache based on a key.
 void SetEntry(java.lang.String key, java.lang.Object value, ICacheUpdateListener callback, int timeout)
          Set an attribute with a call back.
 void SetMaxCount(int maxCount)
          Set the max number of objects that can be placed into this cache.
 void SetMaxInactiveInterval(int updateInterval)
          Have this caching manager timeout objects after x number of seconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingManager

public CachingManager()
Creates a new CachingManager object.

Method Detail

Clear

public void Clear()
Remove all the elements in this cache manager.


GetEntry

public java.lang.Object GetEntry(java.lang.String key)
Get an Entry from this Cache.

Parameters:
key - Key to look up the value to return.
Returns:
Object from the cache.

GetKeys

public IXPEnumerator GetKeys()
An IXPEnumertor of all the keys contained in the caching manager.

Returns:
A String[] of all the keys contained in the caching manager.

GetMaxCount

public int GetMaxCount()
Get the max number of objects that can be placed on this cache.

Returns:
The max number of objects this cache manager can hold.
See Also:
SetMaxCount

GetNumItems

public int GetNumItems()
Get the number of objects placed on this cache.

Returns:
The number of objects this cache manager has.

GetMaxInactiveInterval

public int GetMaxInactiveInterval()
Get the max inactive interval until this cache should timeout objects in the cache.

Returns:
When the cache will timeout objects.

GetMostRecentlyAccessedObject

public java.lang.Object GetMostRecentlyAccessedObject()
Get the most recently accessed Object (by set or get).

Returns:
The object that has the newest timestamp.

GetTimeStamp

public long GetTimeStamp(java.lang.String key)
Get the time stamp of an Entry from this Cache.

Parameters:
key - Key to look up the value to return.
Returns:
long timestamp of the object from the cache. -1 if there was an error

RemoveEntry

public void RemoveEntry(java.lang.String key)
Remove an attribute from the caching manager.

Parameters:
key - The key to remove.

SetEntry

public java.lang.String SetEntry(java.lang.Object value)
Place an object on the cache. Key is generated.

Parameters:
value - The value interested in storing in the cache.
Returns:
String used by GetAttribute to get the object

SetEntry

public void SetEntry(java.lang.String key,
                     java.lang.Object value)
Place an object on the cache based on a key.

Parameters:
key - The key to place the value under.
value - The value interested in storing on the cache.

SetEntry

public void SetEntry(java.lang.String key,
                     java.lang.Object value,
                     ICacheUpdateListener callback,
                     int timeout)
Set an attribute with a call back. The callback will be called when the caching manager asks for the key from GetEntry and the timeout has elapsed.

Parameters:
key - Key on the cache
value - The value to place on the cache.
callback - Object to call back when time has elapsed.
timeout - Time in seconds before calling the callback.

SetMaxCount

public void SetMaxCount(int maxCount)
Set the max number of objects that can be placed into this cache. After the max count is reached the object used last will be removed to make space.

Parameters:
maxCount - The max number of objects this cache can hold.

SetMaxInactiveInterval

public void SetMaxInactiveInterval(int updateInterval)
Have this caching manager timeout objects after x number of seconds. 0 or a negative number means all the objects will not timeout

Parameters:
updateInterval -



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.