Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


com.tangosol.net.cache
Class AbstractEvictionPolicy

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.net.cache.AbstractEvictionPolicy

All Implemented Interfaces:
ConfigurableCacheMap.EvictionPolicy, MapListener, EventListener

public abstract class AbstractEvictionPolicy
extends Base
implements ConfigurableCacheMap.EvictionPolicy, MapListener

An abstract base class for custom cache eviction policies.

Author:
jh 2005.12.14

Constructor Summary
AbstractEvictionPolicy()
           

 

Method Summary
protected  ConfigurableCacheMap ensureCache(MapEvent evt)
          Return the ConfigurableCacheMap that uses this eviction policy.
 void entryDeleted(MapEvent evt)
          Invoked when a map entry has been removed.
 void entryInserted(MapEvent evt)
          Invoked when a map entry has been inserted.
abstract  void entryUpdated(ConfigurableCacheMap.Entry entry)
          This method is called to indicate that an entry has been either inserted or updated.
 void entryUpdated(MapEvent evt)
          Invoked when a map entry has been updated.
protected  ConfigurableCacheMap getCache()
          Return the ConfigurableCacheMap that uses this eviction policy.
protected  ConfigurableCacheMap.Entry getEntry(MapEvent evt)
          Return the map entry associated with the given map event.
 String getName()
          Obtain the name of the eviction policy.

 

Methods inherited from interface com.tangosol.net.cache.ConfigurableCacheMap.EvictionPolicy
entryTouched, requestEviction

 

Constructor Detail

AbstractEvictionPolicy

public AbstractEvictionPolicy()

Method Detail

getName

public String getName()
Obtain the name of the eviction policy. This is intended to be human readable for use in a monitoring tool; examples include "LRU" and "LFU".
Specified by:
getName in interface ConfigurableCacheMap.EvictionPolicy
Returns:
the name of the eviction policy

entryInserted

public void entryInserted(MapEvent evt)
Invoked when a map entry has been inserted.
Specified by:
entryInserted in interface MapListener
Parameters:
evt - the MapEvent carrying the insert information

entryUpdated

public void entryUpdated(MapEvent evt)
Invoked when a map entry has been updated.
Specified by:
entryUpdated in interface MapListener
Parameters:
evt - the MapEvent carrying the update information

entryDeleted

public void entryDeleted(MapEvent evt)
Invoked when a map entry has been removed.
Specified by:
entryDeleted in interface MapListener
Parameters:
evt - the MapEvent carrying the delete information

entryUpdated

public abstract void entryUpdated(ConfigurableCacheMap.Entry entry)
This method is called to indicate that an entry has been either inserted or updated.
Parameters:
entry - the Entry that has been inserted or updated

ensureCache

protected ConfigurableCacheMap ensureCache(MapEvent evt)
Return the ConfigurableCacheMap that uses this eviction policy. <p/> If the ConfigurableCacheMap property has not been intialized, it is set to the ConfigurableCacheMap that raised the given event.
Parameters:
evt - the MapEvent raised by the ConfigurableCacheMap that uses this eviction policy
Returns:
the ConfigurableCacheMap that uses this eviction policy

getEntry

protected ConfigurableCacheMap.Entry getEntry(MapEvent evt)
Return the map entry associated with the given map event.
Parameters:
evt - a map event raised by the cache that uses this eviction policy
Returns:
the map entry associated with the given event

getCache

protected ConfigurableCacheMap getCache()
Return the ConfigurableCacheMap that uses this eviction policy. The ConfigurableCacheMap is set the first time a map event is processed by the eviction policy.
Returns:
the ConfigurableCacheMap or null if a map event has not yet been processed by this eviction policy

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


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