|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
java.util.AbstractMap
com.tangosol.util.SafeHashMap
com.tangosol.net.cache.OldCache
Deprecated. As of Coherence 3.1, use LocalCache instead
public class OldCache
A generic cache manager.
The implementation is thread safe and uses a combination of Most Recently Used (MRU) and Most Frequently Used (MFU) caching strategies.
The cache is size-limited, which means that once it reaches its maximum size ("high-water mark") it prunes itself (to its "low-water mark"). The cache high- and low-water-marks are measured in terms of "units", and each cached item by default uses one unit. All of the cache constructors, except for the default constructor, require the maximum number of units to be passed in. To change the number of units that each cache entry uses, either set the Units property of the cache entry, or extend the Cache implementation so that the inner Entry class calculates its own unit size. To determine the current, high-water and low-water sizes of the cache, use the cache object's Units, HighUnits and LowUnits properties. The HighUnits and LowUnits properties can be changed, even after the cache is in use. To specify the LowUnits value as a percentage when constructing the cache, use the extended constructor taking the percentage-prune-level.
Each cached entry expires after one hour by default. To alter this behavior, use a constructor that takes the expiry-millis; for example, an expiry-millis value of 10000 will expire entries after 10 seconds. The ExpiryDelay property can also be set once the cache is in use, but it will not affect the expiry of previously cached items.
Cache hit statistics can be obtained from the CacheHits, CacheMisses, HitProbability, KeyHitProbability and CompositeHitProbability read-only properties. The statistics can be reset by invoking resetHitStatistics. The statistics are automatically reset when the cache is cleared (the clear method).
The OldCache implements the ObservableMap interface, meaning it provides event notifications to any interested listener for each insert, update and delete, including those that occur when the cache is pruned or entries are automatically expired.
This implementation is designed to support extension through inheritance. When overriding the inner Entry class, the OldCache.instantiateEntry factory method must be overridden to instantiate the correct Entry sub-class. To override the one-unit-per-entry default behavior, extend the inner Entry class and override the calculateUnits method.
| Nested Class Summary | |
|---|---|
class |
OldCache.EntryDeprecated. A holder for a cached value. |
protected class |
OldCache.EntrySetDeprecated. A set of entries backed by this map. |
static interface |
OldCache.EvictionPolicyDeprecated. An eviction policy is an object that the cache provides with access information, and when requested, the eviction policy selects and evicts entries from the cache. |
static class |
OldCache.InternalEvictionPolicyDeprecated. The InternalEvictionPolicy represents a pluggable eviction policy for the non-pluggable built-in (internal) eviction policies supported by this cache implementation. |
static class |
OldCache.InternalUnitCalculatorDeprecated. The InternalUnitCalculator represents a pluggable UnitCalculator for the non-pluggable built-in (internal) UnitCalculator implementation provided by this cache implementation. |
protected class |
OldCache.KeySetDeprecated. A set of entries backed by this map. |
static interface |
OldCache.UnitCalculatorDeprecated. A unit calculator is an object that can calculate the cost of caching an object. |
protected class |
OldCache.ValuesCollectionDeprecated. A collection of values backed by this map. |
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
java.util.AbstractMap.SimpleEntry, java.util.AbstractMap.SimpleImmutableEntry |
| Nested classes/interfaces inherited from interface com.tangosol.net.cache.ConfigurableCacheMap |
|---|
ConfigurableCacheMap.EvictionApprover |
| Field Summary | |
|---|---|
static int |
DEFAULT_EXPIREDeprecated. By default, the cache entries expire after one hour. |
static int |
DEFAULT_FLUSHDeprecated. as of Coherence 3.5 |
static double |
DEFAULT_PRUNEDeprecated. By default, when the cache prunes, it reduces its entries to this percentage. |
static int |
DEFAULT_UNITSDeprecated. By default, the cache size (in units). |
static int |
EVICTION_POLICY_EXTERNALDeprecated. The cache can prune using an external eviction policy. |
static int |
EVICTION_POLICY_HYBRIDDeprecated. By default, the cache prunes based on a hybrid LRU+LFU algorithm. |
static int |
EVICTION_POLICY_LFUDeprecated. The cache can prune based on a pure Least Frequently Used (LFU) algorithm. |
static int |
EVICTION_POLICY_LRUDeprecated. The cache can prune based on a pure Least Recently Used (LRU) algorithm. |
static OldCache.UnitCalculator |
INSTANCE_BINARYDeprecated. The UnitCalculator object that measures the bytes used by entries. |
static OldCache.UnitCalculator |
INSTANCE_FIXEDDeprecated. The UnitCalculator object that counts each entry as one unit. |
static OldCache.EvictionPolicy |
INSTANCE_HYBRIDDeprecated. The EvictionPolicy object for the Hybrid eviction algorithm. |
static OldCache.EvictionPolicy |
INSTANCE_LFUDeprecated. The EvictionPolicy object for the Least Frequently Used (LFU) eviction algorithm. |
static OldCache.EvictionPolicy |
INSTANCE_LRUDeprecated. The EvictionPolicy object for the Least Recently Used (LRU) eviction algorithm. |
protected ConfigurableCacheMap.EvictionApprover |
m_apprvrEvictDeprecated. The EvictionApprover. |
protected LongArray |
m_arrayExpiryDeprecated. Array of set of keys, indexed by the time of expiry. |
protected ConfigurableCacheMap.UnitCalculator |
m_calculatorDeprecated. The external unit calculator. |
protected int |
m_cAvgTouchDeprecated. For a prune cycle, this value is the average number of touches that an entry should have. |
protected long |
m_cCurUnitsDeprecated. The current number of units in the cache. |
protected int |
m_cExpiryDelayDeprecated. The number of milliseconds that a value will live in the cache. |
protected long |
m_cMaxUnitsDeprecated. The number of units to allow the cache to grow to before pruning. |
protected long |
m_cPruneUnitsDeprecated. The number of units to prune the cache down to. |
protected double |
m_dflPruneLevelDeprecated. The percentage of the total number of units that will remain after the cache manager prunes the cache (i.e. this is the "low water mark" value); this value is in the range 0.0 to 1.0. |
protected boolean |
m_fIncrementalEvictDeprecated. Specifies whether or not this cache will incrementally evict. |
protected java.util.Iterator |
m_iterEvictDeprecated. For deferred eviction, iterator of entries to evict. |
protected MapListenerSupport |
m_listenerSupportDeprecated. The MapListenerSupport object. |
protected long |
m_lLastPruneDeprecated. The last time that a prune was run. |
protected long |
m_lNextFlushDeprecated. The time before which a expired-entries flush will not be performed. |
protected int |
m_nCalculatorTypeDeprecated. The type of unit calculator employed by the cache; one of the UNIT_CALCULATOR_* enumerated values. |
protected int |
m_nEvictionTypeDeprecated. The type of eviction policy employed by the cache; one of the EVICTION_POLICY_* enumerated values. |
protected int |
m_nUnitFactorDeprecated. The unit factor. |
protected ConfigurableCacheMap.EvictionPolicy |
m_policyDeprecated. The eviction policy; for eviction type EVICTION_POLICY_EXTERNAL. |
protected SimpleCacheStatistics |
m_statsDeprecated. The CacheStatistics object maintained by this cache. |
static int |
UNIT_CALCULATOR_BINARYDeprecated. Specifies a unit calculator that assigns an object a weight equal to the number of bytes of memory required to cache the object. |
static int |
UNIT_CALCULATOR_EXTERNALDeprecated. Specifies a external (custom) unit calculator implementation. |
static int |
UNIT_CALCULATOR_FIXEDDeprecated. Specifies the default unit calculator that weighs all entries equally as 1. |
| Fields inherited from class com.tangosol.util.SafeHashMap |
|---|
BIGGEST_MODULO, DEFAULT_GROWTHRATE, DEFAULT_INITIALSIZE, DEFAULT_LOADFACTOR, m_aeBucket, m_cCapacity, m_cEntries, m_colValues, m_flGrowthRate, m_flLoadFactor, m_oIterActive, m_setEntries, m_setKeys, PRIME_MODULO, RESIZING |
| Fields inherited from interface com.tangosol.net.cache.CacheMap |
|---|
EXPIRY_DEFAULT, EXPIRY_NEVER |
| Constructor Summary | |
|---|---|
OldCache()Deprecated. Construct the cache manager. |
|
OldCache(int cUnits)Deprecated. Construct the cache manager. |
|
OldCache(int cUnits, int cExpiryMillis)Deprecated. Construct the cache manager. |
|
OldCache(int cUnits, int cExpiryMillis, double dflPruneLevel)Deprecated. Construct the cache manager. |
|
| Method Summary | |
|---|---|
void |
addMapListener(MapListener listener)Deprecated. Add a standard map listener that will receive all events (inserts, updates, deletes) that occur against the map, with the key, old-value and new-value included. |
void |
addMapListener(MapListener listener, Filter filter, boolean fLite)Deprecated. Add a map listener that receives events based on a filter evaluation. |
void |
addMapListener(MapListener listener, java.lang.Object oKey, boolean fLite)Deprecated. Add a map listener for a specific key. |
protected void |
adjustUnits(int cDelta)Deprecated. Adjust current size. |
protected void |
checkFlush()Deprecated. as of Coherence 3.5, use evict() |
protected void |
checkSize()Deprecated. Check if the cache is too big, and if it is prune it by discarding the lowest priority cache entries. |
void |
clear()Deprecated. Remove everything from the cache. |
protected void |
configureEviction(int nType, ConfigurableCacheMap.EvictionPolicy policy)Deprecated. Configure the eviction type and policy. |
protected void |
configureUnitCalculator(int nType, ConfigurableCacheMap.UnitCalculator calculator)Deprecated. Configure the unit calculator type and implementation. |
boolean |
containsKey(java.lang.Object key)Deprecated. Returns true if the cache contains the specified key. |
protected void |
dispatchEvent(MapEvent evt)Deprecated. Dispatch the passed event. |
void |
evict()Deprecated. Evict all entries from the cache that are no longer valid, and potentially prune the cache size if the cache is size-limited and its size is above the caching low water mark. |
void |
evict(java.lang.Object oKey)Deprecated. Evict a specified key from the cache, as if it had expired from the cache. |
void |
evictAll(java.util.Collection colKeys)Deprecated. Evict the specified keys from the cache, as if they had each expired from the cache. |
java.lang.Object |
get(java.lang.Object oKey)Deprecated. If the specified item is in the cache, return it. |
java.util.Map |
getAll(java.util.Collection colKeys)Deprecated. Get all the specified keys, if they are in the cache. |
ConfigurableCacheMap.Entry |
getCacheEntry(java.lang.Object oKey)Deprecated. Locate a cache Entry in the cache based on its key. |
long |
getCacheHits()Deprecated. Determine the rough number of cache hits since the cache statistics were last reset. |
long |
getCacheMisses()Deprecated. Determine the rough number of cache misses since the cache statistics were last reset. |
CacheStatistics |
getCacheStatistics()Deprecated. Returns the CacheStatistics for this cache. |
SafeHashMap.Entry |
getEntry(java.lang.Object oKey)Deprecated. Locate an Entry in the hash map based on its key. |
protected SafeHashMap.Entry |
getEntryInternal(java.lang.Object oKey)Deprecated. Locate an Entry in the hash map based on its key. |
ConfigurableCacheMap.EvictionApprover |
getEvictionApprover()Deprecated. Obtain the registered EvictionApprover. |
ConfigurableCacheMap.EvictionPolicy |
getEvictionPolicy()Deprecated. Obtain the current EvictionPolicy used by the cache. |
int |
getEvictionType()Deprecated. Determine the current eviction type. |
int |
getExpiryDelay()Deprecated. Determine the default "time to live" for each individual cache entry. |
long |
getFlushTime()Deprecated. as of Coherence 3.5 |
int |
getHighUnits()Deprecated. Determine the limit of the cache size in units. |
double |
getHitProbability()Deprecated. Determine the rough probability (0 <= p <= 1) that any particular get(java.lang.Object) invocation will be satisfied by an existing entry in the cache, based on the statistics collected since the last reset of the cache statistics. |
int |
getLowUnits()Deprecated. Determine the point to which the cache will shrink when it prunes. |
protected MapListenerSupport |
getMapListenerSupport()Deprecated. Accessor for the MapListenerSupport for sub-classes. |
ConfigurableCacheMap.UnitCalculator |
getUnitCalculator()Deprecated. Obtain the current UnitCalculator used by the cache. |
int |
getUnitCalculatorType()Deprecated. Determine the current unit calculator type. |
int |
getUnitFactor()Deprecated. Determine the factor by which the Units, LowUnits and HighUnits properties are adjusted. |
int |
getUnits()Deprecated. Determine the number of units that the cache currently stores. |
protected boolean |
hasListeners()Deprecated. Determine if the OldCache has any listeners at all. |
protected SafeHashMap.Entry |
instantiateEntry()Deprecated. Factory method. |
protected SafeHashMap.EntrySet |
instantiateEntrySet()Deprecated. Factory pattern. |
protected SafeHashMap.KeySet |
instantiateKeySet()Deprecated. Factory pattern. |
protected MapEvent |
instantiateMapEvent(int nId, java.lang.Object oKey, java.lang.Object oValueOld, java.lang.Object oValueNew)Deprecated. Factory pattern: instantiate a new MapEvent corresponding to the specified parameters. |
protected SafeHashMap.ValuesCollection |
instantiateValuesCollection()Deprecated. Factory pattern. |
boolean |
isIncrementalEviction()Deprecated. Determine if incremental eviction is enabled. |
protected void |
prune()Deprecated. Prune the cache by discarding the lowest priority cache entries. |
java.lang.Object |
put(java.lang.Object oKey, java.lang.Object oValue)Deprecated. Store a value in the cache. |
java.lang.Object |
put(java.lang.Object oKey, java.lang.Object oValue, long cMillis)Deprecated. Store a value in the cache that will be automatically evicted according to the specified expiration value. |
java.lang.Object |
remove(java.lang.Object oKey)Deprecated. Remove an entry from the cache. |
protected boolean |
removeEvicted(OldCache.Entry entry)Deprecated. Remove an entry (if it is eligible for eviction) because it has expired. |
protected boolean |
removeExpired(OldCache.Entry entry, boolean fRemoveInternal)Deprecated. use removeEvicted(Entry) instead |
protected boolean |
removeIfExpired(OldCache.Entry entry)Deprecated. Remove an entry if it has expired. |
void |
removeMapListener(MapListener listener)Deprecated. Remove a standard map listener that previously signed up for all events. |
void |
removeMapListener(MapListener listener, Filter filter)Deprecated. Remove a map listener that previously signed up for events based on a filter evaluation. |
void |
removeMapListener(MapListener listener, java.lang.Object oKey)Deprecated. Remove a map listener that previously signed up for events about a specific key. |
void |
resetHitStatistics()Deprecated. Reset the cache statistics. |
void |
setEvictionApprover(ConfigurableCacheMap.EvictionApprover approver)Deprecated. Set the EvictionApprover for this ConfigurableCacheMap. |
void |
setEvictionPolicy(ConfigurableCacheMap.EvictionPolicy policy)Deprecated. Set the EvictionPolicy for the cache to use. |
void |
setEvictionType(int nType)Deprecated. Specify the eviction type for the cache. |
void |
setExpiryDelay(int cMillis)Deprecated. Specify the default "time to live" for cache entries. |
void |
setFlushTime(long lMillis)Deprecated. as of Coherence 3.5 |
void |
setHighUnits(int cMax)Deprecated. Update the maximum size of the cache in units. |
void |
setIncrementalEviction(boolean fIncrementalEvict)Deprecated. Sepcify whether incremental eviction is enabled. |
void |
setLowUnits(int cMin)Deprecated. Specify the point to which the cache will shrink when it prunes. |
void |
setUnitCalculator(ConfigurableCacheMap.UnitCalculator calculator)Deprecated. Set the UnitCalculator for the cache to use. |
void |
setUnitCalculatorType(int nType)Deprecated. Specify the unit calculator type for the cache. |
void |
setUnitFactor(int nFactor)Deprecated. Determine the factor by which the Units, LowUnits and HighUnits properties are adjusted. |
int |
size()Deprecated. Returns the number of key-value mappings in this map. |
protected static int |
toExternalUnits(long cUnits, int nFactor)Deprecated. Convert from an internal 64-bit unit value to an external 32-bit unit value using the configured units factor. |
protected static long |
toInternalUnits(int cUnits, int nFactor)Deprecated. Convert from an external 32-bit unit value to an internal 64-bit unit value using the configured units factor. |
java.lang.String |
toString()Deprecated. For debugging purposes, format the contents of the cache as a String. |
| Methods inherited from class com.tangosol.util.SafeHashMap |
|---|
clone, cloneEntryList, entrySet, getBucketIndex, getStableBucketArray, grow, instantiateEntry, isActiveIterator, isEmpty, iteratorActivated, iteratorDeactivated, keySet, removeEntryInternal, values |
| Methods inherited from class java.util.AbstractMap |
|---|
containsValue, equals, hashCode, putAll |
| Methods inherited from interface java.util.Map |
|---|
containsValue, entrySet, equals, hashCode, isEmpty, keySet, putAll, values |
| Field Detail |
|---|
public static final int DEFAULT_UNITS
public static final int DEFAULT_EXPIRE
public static final int DEFAULT_FLUSH
public static final double DEFAULT_PRUNE
public static final int EVICTION_POLICY_HYBRID
public static final int EVICTION_POLICY_LRU
public static final int EVICTION_POLICY_LFU
public static final int EVICTION_POLICY_EXTERNAL
public static final int UNIT_CALCULATOR_FIXED
public static final int UNIT_CALCULATOR_BINARY
BinaryMemoryCalculator, Constant Field Valuespublic static final int UNIT_CALCULATOR_EXTERNAL
public static final OldCache.EvictionPolicy INSTANCE_HYBRID
public static final OldCache.EvictionPolicy INSTANCE_LRU
public static final OldCache.EvictionPolicy INSTANCE_LFU
public static final OldCache.UnitCalculator INSTANCE_FIXED
public static final OldCache.UnitCalculator INSTANCE_BINARY
protected volatile long m_cCurUnits
protected long m_cMaxUnits
protected double m_dflPruneLevel
protected long m_cPruneUnits
protected int m_nUnitFactor
protected int m_cExpiryDelay
protected volatile long m_lNextFlush
protected SimpleCacheStatistics m_stats
protected MapListenerSupport m_listenerSupport
protected int m_nEvictionType
protected ConfigurableCacheMap.EvictionPolicy m_policy
protected int m_nCalculatorType
protected ConfigurableCacheMap.UnitCalculator m_calculator
protected LongArray m_arrayExpiry
protected long m_lLastPrune
protected int m_cAvgTouch
protected java.util.Iterator m_iterEvict
protected boolean m_fIncrementalEvict
protected ConfigurableCacheMap.EvictionApprover m_apprvrEvict
| Constructor Detail |
|---|
public OldCache()
public OldCache(int cUnits)
cUnits - the number of units that the cache manager will cache before pruning the cache
public OldCache(int cUnits,
int cExpiryMillis)
cUnits - the number of units that the cache manager will cache before pruning the cachecExpiryMillis - the number of milliseconds that each cache entry lives before being automatically expired
public OldCache(int cUnits,
int cExpiryMillis,
double dflPruneLevel)
cUnits - the number of units that the cache manager will cache before pruning the cachecExpiryMillis - the number of milliseconds that each cache entry lives before being automatically expireddflPruneLevel - the percentage of the total number of units that will remain after the cache manager prunes the cache (i.e. this is the "low water mark" value); this value is in the range 0.0 to 1.0| Method Detail |
|---|
public int size()
size in interface java.util.Mapsize in class SafeHashMappublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.MapcontainsKey in class SafeHashMapkey - key whose presence in this map is to be testedpublic java.lang.Object get(java.lang.Object oKey)
get in interface java.util.Mapget in class SafeHashMapoKey - the key to the desired cached itempublic SafeHashMap.Entry getEntry(java.lang.Object oKey)
getEntry in class SafeHashMapoKey - the key object to search forpublic ConfigurableCacheMap.Entry getCacheEntry(java.lang.Object oKey)
getCacheEntry in interface ConfigurableCacheMapoKey - the key object to search for
public java.lang.Object put(java.lang.Object oKey,
java.lang.Object oValue)
put in interface CacheMapput in interface java.util.Mapput in class SafeHashMapoKey - the key with which to associate the cache valueoValue - the value to cache
public java.lang.Object put(java.lang.Object oKey,
java.lang.Object oValue,
long cMillis)
put in interface CacheMapoKey - the key with which to associate the cache valueoValue - the value to cachecMillis - the number of milliseconds until the entry will expire; pass zero to use the cache's default ExpiryDelay settings; pass -1 to indicate that the entry should never expirepublic java.lang.Object remove(java.lang.Object oKey)
remove in interface java.util.Mapremove in class SafeHashMapoKey - the key of a cached valuepublic void clear()
clear in interface java.util.Mapclear in class SafeHashMappublic void addMapListener(MapListener listener)
addMapListener(listener, (Filter) null, false);
addMapListener in interface ObservableMaplistener - the MapEvent listener to addpublic void removeMapListener(MapListener listener)
removeMapListener(listener, (Filter) null);
removeMapListener in interface ObservableMaplistener - the listener to remove
public void addMapListener(MapListener listener,
java.lang.Object oKey,
boolean fLite)
The listeners will receive MapEvent objects, but if fLite is passed as true, they might not contain the OldValue and NewValue properties.
To unregister the MapListener, use the ObservableMap.removeMapListener(MapListener, Object) method.
addMapListener in interface ObservableMaplistener - the MapEvent listener to addoKey - the key that identifies the entry for which to raise eventsfLite - true to indicate that the MapEvent objects do not have to include the OldValue and NewValue property values in order to allow optimizations
public void removeMapListener(MapListener listener,
java.lang.Object oKey)
removeMapListener in interface ObservableMaplistener - the listener to removeoKey - the key that identifies the entry for which to raise events
public void addMapListener(MapListener listener,
Filter filter,
boolean fLite)
The listeners will receive MapEvent objects, but if fLite is passed as true, they might not contain the OldValue and NewValue properties.
To unregister the MapListener, use the ObservableMap.removeMapListener(MapListener, Filter) method.
addMapListener in interface ObservableMaplistener - the MapEvent listener to addfilter - a filter that will be passed MapEvent objects to select from; a MapEvent will be delivered to the listener only if the filter evaluates to true for that MapEvent (see MapEventFilter); null is equivalent to a filter that alway returns truefLite - true to indicate that the MapEvent objects do not have to include the OldValue and NewValue property values in order to allow optimizations
public void removeMapListener(MapListener listener,
Filter filter)
removeMapListener in interface ObservableMaplistener - the listener to removefilter - the filter that was passed into the corresponding addMapListener() callpublic java.util.Map getAll(java.util.Collection colKeys)
The result of this method is defined to be semantically the same as the following implementation, without regards to threading issues:
Map map = new AnyMap(); // could be a HashMap (but does not have to)
for (Iterator iter = colKeys.iterator(); iter.hasNext(); )
{
Object oKey = iter.next();
Object oVal = get(oKey);
if (oVal != null || containsKey(oKey))
{
map.put(oKey, oVal);
}
}
return map;
getAll in interface CacheMapcolKeys - a collection of keys that may be in the named cachepublic void evict(java.lang.Object oKey)
evict in interface ConfigurableCacheMapoKey - the key to evict from the cachepublic void evictAll(java.util.Collection colKeys)
The result of this method is defined to be semantically the same as the following implementation: for (Iterator iter = colKeys.iterator(); iter.hasNext(); ) { Object oKey = iter.next(); evict(oKey); }
evictAll in interface ConfigurableCacheMapcolKeys - a collection of keys to evict from the cachepublic void evict()
evict in interface ConfigurableCacheMappublic CacheStatistics getCacheStatistics()
protected SafeHashMap.EntrySet instantiateEntrySet()
instantiateEntrySet in class SafeHashMapprotected SafeHashMap.KeySet instantiateKeySet()
instantiateKeySet in class SafeHashMapprotected SafeHashMap.ValuesCollection instantiateValuesCollection()
instantiateValuesCollection in class SafeHashMappublic java.lang.String toString()
toString in class java.util.AbstractMappublic int getUnits()
Note: It is expected that the return type will be widened to a long in Coherence 4.
getUnits in interface ConfigurableCacheMappublic int getHighUnits()
Note: It is expected that the return type will be widened to a long in Coherence 4.
getHighUnits in interface ConfigurableCacheMappublic void setHighUnits(int cMax)
Note: It is expected that the parameter will be widened to a long in Coherence 4.
setHighUnits in interface ConfigurableCacheMapcMax - the new maximum size of the cache, in unitspublic int getLowUnits()
Note: It is expected that the parameter will be widened to a long in Coherence 4.
getLowUnits in interface ConfigurableCacheMappublic void setLowUnits(int cMin)
Note: It is expected that the parameter will be widened to a long in Coherence 4.
setLowUnits in interface ConfigurableCacheMapcMin - the number of units that the cache prunes topublic int getUnitFactor()
Note: This property exists only to avoid changing the type of the units, low units and high units properties from 32-bit values to 64-bit values. It is expected that the parameter will be dropped in Coherence 4.
getUnitFactor in interface ConfigurableCacheMappublic void setUnitFactor(int nFactor)
Note: This property exists only to avoid changing the type of the units, low units and high units properties from 32-bit values to 64-bit values. It is expected that the parameter will be dropped in Coherence 4.
setUnitFactor in interface ConfigurableCacheMapnFactor - the units factor; the default is 1
protected static long toInternalUnits(int cUnits,
int nFactor)
cUnits - an external 32-bit units value
protected static int toExternalUnits(long cUnits,
int nFactor)
cUnits - an internal 64-bit units valuenFactor - the unit factorpublic int getEvictionType()
public void setEvictionType(int nType)
nType - one of the EVICTION_POLICY_* enumerated valuespublic ConfigurableCacheMap.EvictionPolicy getEvictionPolicy()
getEvictionPolicy in interface ConfigurableCacheMappublic void setEvictionPolicy(ConfigurableCacheMap.EvictionPolicy policy)
setEvictionPolicy in interface ConfigurableCacheMappolicy - an EvictionPolicypublic ConfigurableCacheMap.EvictionApprover getEvictionApprover()
getEvictionApprover in interface ConfigurableCacheMappublic void setEvictionApprover(ConfigurableCacheMap.EvictionApprover approver)
setEvictionApprover in interface ConfigurableCacheMapapprover - the EvictionApproverpublic int getUnitCalculatorType()
public void setUnitCalculatorType(int nType)
nType - one of the UNIT_CALCULATOR_* enumerated valuespublic ConfigurableCacheMap.UnitCalculator getUnitCalculator()
getUnitCalculator in interface ConfigurableCacheMappublic void setUnitCalculator(ConfigurableCacheMap.UnitCalculator calculator)
setUnitCalculator in interface ConfigurableCacheMapcalculator - a UnitCalculatorpublic int getExpiryDelay()
getExpiryDelay in interface ConfigurableCacheMappublic void setExpiryDelay(int cMillis)
setExpiryDelay in interface ConfigurableCacheMapcMillis - the number of milliseconds that cache entries will live, or zero to disable automatic expirypublic long getFlushTime()
public void setFlushTime(long lMillis)
lMillis - the date/time value, in milliseconds, when the cache should next automatically flushpublic boolean isIncrementalEviction()
public void setIncrementalEviction(boolean fIncrementalEvict)
fIncrementalEvict - pass true toe enable incremental eviction; false to disable incremental evictionpublic long getCacheHits()
get(java.lang.Object) calls that have been served by existing cache entriespublic long getCacheMisses()
get(java.lang.Object) calls that failed to find an existing cache entry because the requested key was not in the cachepublic double getHitProbability()
get(java.lang.Object) invocation will be satisfied by an existing entry in the cache, based on the statistics collected since the last reset of the cache statistics.public void resetHitStatistics()
protected void configureEviction(int nType,
ConfigurableCacheMap.EvictionPolicy policy)
nType - one of the EVICTION_POLICY_* enumerated valuespolicy - an external eviction policy, or null
protected void configureUnitCalculator(int nType,
ConfigurableCacheMap.UnitCalculator calculator)
nType - one of the UNIT_CALCULATOR_* enumerated valuescalculator - an external unit calculator, or nullprotected SafeHashMap.Entry getEntryInternal(java.lang.Object oKey)
Unlike the getEntry(java.lang.Object) method, this method does not flush the cache (if necessary) or update cache statistics.
getEntryInternal in class SafeHashMapoKey - the key object to search for
protected boolean removeExpired(OldCache.Entry entry,
boolean fRemoveInternal)
removeEvicted(Entry) insteadNote: This method is the same as removeEvicted(Entry) and is left for backward compatibility.
entry - the expired cache entryfRemoveInternal - true if the cache entry still needs to be removed from the cacheprotected boolean removeEvicted(OldCache.Entry entry)
entry - the expired cache entryprotected boolean removeIfExpired(OldCache.Entry entry)
entry - the entryprotected void adjustUnits(int cDelta)
protected void checkSize()
protected void prune()
protected void checkFlush()
evict()
protected MapEvent instantiateMapEvent(int nId,
java.lang.Object oKey,
java.lang.Object oValueOld,
java.lang.Object oValueNew)
protected MapListenerSupport getMapListenerSupport()
protected boolean hasListeners()
protected void dispatchEvent(MapEvent evt)
evt - a CacheEvent objectprotected SafeHashMap.Entry instantiateEntry()
instantiateEntry in class SafeHashMap
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||