| java.lang.Object org.griphyn.vdl.router.Cache
Cache | public class Cache (Code) | | author: Jens-S. Vöckler author: Yong Zhao version: $Revision: 50 $ |
Inner Class :public class CacheEntry | |
Field Summary | |
java.util.Map | m_cache remember the objects to cache for. | static long[] | m_stats Maintains statistics. | long | m_ttl remember how long to save a cache entry. |
Constructor Summary | |
public | Cache(int ttl) ctor: Initialize the base functionalities of the cache. |
Method Summary | |
public Object | get(Object key) Requests an item from the cache. | public long[] | getStatistics() Requests a copy of the statistics counters. | public Object | set(Object key, Object value) Enters a value into the cache.
Parameters: key - is a concise, unique description of the object. Parameters: value - is the object to be cached. |
m_cache | java.util.Map m_cache(Code) | | remember the objects to cache for. The cache consists of a concise
key to locate any object, a value for the located large object, and
a lifetime for the object.
|
m_stats | static long[] m_stats(Code) | | Maintains statistics.
|
m_ttl | long m_ttl(Code) | | remember how long to save a cache entry.
|
Cache | public Cache(int ttl)(Code) | | ctor: Initialize the base functionalities of the cache.
Parameters: ttl - is the lifetime of a positive entry in seconds. |
get | public Object get(Object key)(Code) | | Requests an item from the cache.
Parameters: key - is the descriptor of the object. |
getStatistics | public long[] getStatistics()(Code) | | Requests a copy of the statistics counters.
the counter values. |
set | public Object set(Object key, Object value)(Code) | | Enters a value into the cache.
Parameters: key - is a concise, unique description of the object. Parameters: value - is the object to be cached. null for a fresh object, or the old CacheEntry. |
|
|