|
Oracle Fusion Middleware Oracle WebLogic Server 10.3.1 API Reference 11g Release 1 (10.3.1) Part Number E13941-02 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweblogic.security.acl.TTLCache
public class TTLCache
Fixed-size pseudo-LRU cache with per-entry TTL attributes. This cache maps keys to values in the usual way, and associates a time-to-live (TTL) value with each map entry.
If the cache is full when an insertion is performed, an approximation to the least-recently-used (LRU) entry is evicted to make room for the new entry.
Entries that become stale, because they have exceeded their tiem-to-live values, are removed from the cache.
Keys are considered immutable; if you change a key after adding it to a cache, the mapping will be lost.
Constructor Summary | |
---|---|
TTLCache(int buckets,
int capacity,
long ttl)
Deprecated. Construct a new cache. |
|
TTLCache(int buckets,
long ttl)
Deprecated. Construct a new cache. |
Method Summary | |
---|---|
void |
cleanup()
Deprecated. Force the cache to be cleaned. |
void |
clear()
Deprecated. Clear the cache. |
boolean |
containsKey(Object key)
Deprecated. |
Object |
get(Object key)
Deprecated. Return the value associated with the given key, or null if none. |
LogOutputStream |
getDebugLog()
Deprecated. |
double |
getHitRate()
Deprecated. The hit rate for lookups performed since this cache was constructed or last cleared. |
int |
getInsertions()
Deprecated. The number of insertions performed since this cache was constructed or last cleared. |
int |
getLookups()
Deprecated. The number of lookups performed since this cache was constructed or last cleared. |
double |
getLRUEvictionRate()
Deprecated. The LRU eviction rate for insertions performed since this cache was constructed or last cleared. |
double |
getStaleEvictionRate()
Deprecated. The stale eviction rate for insertions performed since this cache was constructed or last cleared. |
boolean |
isEmpty()
Deprecated. Indicate whether this table is empty. |
Object |
put(Object keyValue)
Deprecated. Insert a new entry into the cache. |
Object |
put(Object key,
Object value)
Deprecated. Insert a new entry into the cache. |
Object |
remove(Object key)
Deprecated. Remove the mapping for the given key from the cache. |
void |
setDebugLog(LogOutputStream debug)
Deprecated. |
int |
size()
Deprecated. Return an approximate indication of the size of this table. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TTLCache(int buckets, long ttl)
For best performance, the number of the buckets should be prime.
buckets
- number of bucketsttl
- time-to-live for entries, in millisecondspublic TTLCache(int buckets, int capacity, long ttl)
For best performance, the number of buckets should be prime, and the capacity of the cache should be roughly a small multiple (between 4 and 10) of the number of buckets.
buckets
- number of bucketscapacity
- capacity of the cachettl
- time-to-live for entries, in millisecondsMethod Detail |
---|
public Object put(Object key, Object value)
key
- (may not be null)value
- (may not be null)
public Object put(Object keyValue)
keyValue
- key and value (may not be null)
public Object get(Object key)
public Object remove(Object key)
key
- the key of the mapping to remove
public void clear()
public void cleanup()
public int size()
public boolean isEmpty()
public boolean containsKey(Object key)
public void setDebugLog(LogOutputStream debug)
public LogOutputStream getDebugLog()
public int getLookups()
public double getHitRate()
If this method is called before any lookups have been performed, a divide-by-zero exception will result.
public int getInsertions()
public double getStaleEvictionRate()
If this method is called before any lookups have been performed, a divide-by-zero exception will result.
public double getLRUEvictionRate()
If this method is called before any lookups have been performed, a divide-by-zero exception will result.
|
Documentation is available at http://download.oracle.com/docs/cd/E12839_01/web.1111/wls.htm Copyright 1996, 2009, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Oracle Fusion Middleware Oracle WebLogic Server 10.3.1 API Reference 11g Release 1 (10.3.1) Part Number E13941-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |