Skip navigation links

Overview | Package | Class | Tree | Index | Help
| Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tangosol.util
Interface MapListenerSupport.SynchronousListener

All Superinterfaces:
  EventListener, MapListener, SynchronousListener

All Known Implementing Classes:
  CachingMap.BackMapListener, CachingMap.FrontMapListener, ContinuousQueryCache.AddListener, ContinuousQueryCache.RemoveListener, InvocableMapHelper.IndexAdapter, MapListenerSupport.WrapperSynchronousListener

Enclosing class:
  MapListenerSupport

      public static interface MapListenerSupport.SynchronousListener

extends SynchronousListener, MapListener

A tag interface indicating that tagged MapListener implementation has to receive the MapEvent notifications in a synchronous manner.

Consider a MapListener that subscribes to receive notifications for distributed (partitioned) cache. All events notifications are received by the service thread and immediately queued to be processed by the dedicated event dispatcher thread. This makes it impossible to differentiate between the event caused by the updates made by this thread and any other thread (possibly in a different VM). Forcing the events to be processed on the service thread guarantees that by the time "put" or "remove" requests return to the caller all relevant MapEvent notification have been processed (due to the "in order delivery" rule enforced by the TCMP).

This interface should be considered as a very advanced feature, so a MapListener implementation that is tagged as a SynchronousListener must exercise extreme caution during event processing since any delay with return or unhandled exception will cause a delay or complete shutdown of the corresponding cache service.

Note: The contract by the event producer in respect to the SynchronousListener is somewhat weaker then the general one. First, the SynchronousListener implementaion should make no assumptions about the event source obtained by `MapEvent.getMap()`. Second, in the event of [automatic] service restart, the listener has to be re-registered manually (for example, in response to the `MEMBER_JOINED` event). Third, and the most important, no calls against the NamedCache are allowed during the synchronous event processing (the only exception being a call to remove the listener itself).

Method Summary

Methods inherited from interface com.tangosol.util.MapListener
`entryDeleted, entryInserted, entryUpdated`

Skip navigation links

Overview | Package | Class | Tree | Index | Help
| Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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