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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.