Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


com.tangosol.net.cache
Class CompactSerializationCache.WrapperEvictionPolicy

java.lang.Object
  extended by com.tangosol.net.cache.CompactSerializationCache.InternalEvictionPolicy
      extended by com.tangosol.net.cache.CompactSerializationCache.WrapperEvictionPolicy

All Implemented Interfaces:
ConfigurableCacheMap.EvictionPolicy
Enclosing class:
CompactSerializationCache

protected class CompactSerializationCache.WrapperEvictionPolicy
extends CompactSerializationCache.InternalEvictionPolicy

WrapperEvictionPolicy is used to wrap external or "custom" EvictionPolicy implementations to adapt the internal Binary key-based API to the Entry-based API.


Nested Class Summary

 

Nested classes/interfaces inherited from class com.tangosol.net.cache.CompactSerializationCache.InternalEvictionPolicy
CompactSerializationCache.InternalEvictionPolicy.EvictionCandidate, CompactSerializationCache.InternalEvictionPolicy.EvictionVisitor

 

Field Summary
protected  ConfigurableCacheMap.EvictionPolicy f_policy
          The underlying (custom) EvictionPolicy.

 

Fields inherited from class com.tangosol.net.cache.CompactSerializationCache.InternalEvictionPolicy
f_visitorTouchCount, f_visitorTouchTime, m_ldtLastEvict

 

Constructor Summary
CompactSerializationCache.WrapperEvictionPolicy(ConfigurableCacheMap.EvictionPolicy policy)
          Construct a WrapperEvictionPolicy.

 

Method Summary
protected  long calculateWeight(Binary binKey)
          Calculate the "weight" of the entry associated with the specified key.
 void entryTouched(Binary binKey)
          This method is called by the cache to indicate that the entry for the specified key has been touched.
 void entryTouched(ConfigurableCacheMap.Entry entry)
          This method is called by the cache to indicate that an entry has been touched.
protected  ConfigurableCacheMap.EvictionPolicy getConfiguredPolicy()
          Return the configured EvictionPolicy instance.
 void requestEviction(int cMaximum)
          This method is called by the cache when the cache requires the eviction policy to evict entries.

 

Methods inherited from class com.tangosol.net.cache.CompactSerializationCache.InternalEvictionPolicy
getName, touchInternal

 

Field Detail

f_policy

protected final ConfigurableCacheMap.EvictionPolicy f_policy
The underlying (custom) EvictionPolicy.

Constructor Detail

CompactSerializationCache.WrapperEvictionPolicy

public CompactSerializationCache.WrapperEvictionPolicy(ConfigurableCacheMap.EvictionPolicy policy)
Construct a WrapperEvictionPolicy.
Parameters:
policy - the underlying EvictionPolicy

Method Detail

entryTouched

public void entryTouched(Binary binKey)
This method is called by the cache to indicate that the entry for the specified key has been touched.
Overrides:
entryTouched in class CompactSerializationCache.InternalEvictionPolicy
Parameters:
binKey - the key

entryTouched

public void entryTouched(ConfigurableCacheMap.Entry entry)
This method is called by the cache to indicate that an entry has been touched.
Specified by:
entryTouched in interface ConfigurableCacheMap.EvictionPolicy
Overrides:
entryTouched in class CompactSerializationCache.InternalEvictionPolicy
Parameters:
entry - the Cache Entry that has been touched

calculateWeight

protected long calculateWeight(Binary binKey)
Calculate the "weight" of the entry associated with the specified key. The weight is a quantitative measure of how to prioritize the eviction of this entry w.r.t. the other cache entries. Entries with a smaller weights are of higher priority and are preferred over entries with larger weights for eviction.
Specified by:
calculateWeight in class CompactSerializationCache.InternalEvictionPolicy
Parameters:
binKey - the key to calculate the weight for

requestEviction

public void requestEviction(int cMaximum)
This method is called by the cache when the cache requires the eviction policy to evict entries.
Specified by:
requestEviction in interface ConfigurableCacheMap.EvictionPolicy
Overrides:
requestEviction in class CompactSerializationCache.InternalEvictionPolicy
Parameters:
cMaximum - the maximum number of units that should remain in the cache when the eviction is complete

getConfiguredPolicy

protected ConfigurableCacheMap.EvictionPolicy getConfiguredPolicy()
Return the configured EvictionPolicy instance.
Specified by:
getConfiguredPolicy in class CompactSerializationCache.InternalEvictionPolicy
Returns:
the configured EvictionPolicy

Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.