Map triggers

Another Coherence feature that relies on cache events is map triggers.

Unlike map listeners, which execute after an event occurs in the cache, map triggers execute before any mutating operation is committed and allow you to validate, modify, or even reject the operation.

You can create a trigger by implementing a class that fulfils the com.tangosol.util.MapTrigger interface:

public interface MapTrigger
       extends Serializable {

  public void process(MapTrigger.Entry entry);

The MapTrigger interface defines a single method, process, which is invoked by Coherence before the result of a mutating operation is committed into the underlying map. The process method accepts a single argument of the MapTrigger.Entry type, which is an extension of ...

Get Oracle Coherence 3.5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.