Oracle Coherence for C++ API


MapListenerSupport::SynchronousListener Class Reference

#include <coherence/util/MapListenerSupport.hpp>

Inherits MapListener.

Inherited by MapListenerSupport::WrapperSynchronousListener [virtual].

List of all members.

Detailed Description

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 {com::tangosol::net::MemberEvent::MEMBER_JOINED 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).

Public Types

typedef spec::Handle Handle
 SynchronousListener Handle definition.
typedef spec::View View
 SynchronousListener View definition.
typedef spec::Holder Holder
 SynchronousListener Holder definition.

The documentation for this class was generated from the following file:
Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.