Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


com.tangosol.net.cache
Class SeppukuMapListener

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

All Implemented Interfaces:
MapListener, java.util.EventListener

public class SeppukuMapListener
extends Base
implements MapListener

A map listener that follows the "seppuku" pattern, invalidating the Map entries when MapEvents for another related ObservableMap are delivered.

Author:
gg 2002.09.10
See Also:
"Seppuku pattern" by Dimitri Rakitine

Constructor Summary
SeppukuMapListener(java.util.Map map)
          Construct a SeppukuMapListener for the specified front map.

 

Method Summary
 void entryDeleted(MapEvent evt)
          Invoked when a map entry has been removed.
 void entryInserted(MapEvent evt)
          Invoked when a map entry has been inserted.
 void entryUpdated(MapEvent evt)
          Invoked when a map entry has been updated.
 java.util.Map getMap()
          Returns the front Map invalidated by this listener.
protected  void validate(java.lang.Object oKey, java.lang.Object oValue)
          Validate the specified entry and remove it from the Map object affected by this listener if and only if the value is different (implying that the entry has been modified elsewhere).

 

Constructor Detail

SeppukuMapListener

public SeppukuMapListener(java.util.Map map)
Construct a SeppukuMapListener for the specified front map.
Parameters:
map - the Map object to modify based on events issued to this Listener from a different ObservableMap object

Method Detail

getMap

public java.util.Map getMap()
Returns the front Map invalidated by this listener.
Returns:
the front Map invalidated by this listener

entryInserted

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

entryUpdated

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

entryDeleted

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

validate

protected void validate(java.lang.Object oKey,
                        java.lang.Object oValue)
Validate the specified entry and remove it from the Map object affected by this listener if and only if the value is different (implying that the entry has been modified elsewhere).
Parameters:
oKey - the entry key
oValue - the "new" entry value; this is potentially different from the one in the map maintained by this Suppuku listener

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


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