public interface EventDispatcherAwareInterceptor<E extends Event<?>> extends EventInterceptor<E>
EventInterceptor
implementation
that takes responsibility for registering itself with the EventDispatcher
.
This allows the EventInterceptor to determine applicability to the
dispatcher in addition to choosing the appropriate registration call
exposed by the EventDispatcher. The following shows an example of a
introduceEventDispatcher
implementation that explicitly states its interest in being the first interceptor
called and to be notified on EntryEvent.Type.INSERTING events exclusively:
public void introduceEventDispatcher(String sIdentifier, EventDispatcher dispatcher)
{
dispatcher.addEventInterceptor(sIdentifier, this,
new HashSet(Arrays.asList(EntryEvent.Type.INSERTING)), true);
}
This interface accommodates for those EventInterceptor implementations
that require a custom registration mechanism outside of the provided
mechanisms; annotation and/or generics.EventInterceptor
Modifier and Type | Method and Description |
---|---|
void |
introduceEventDispatcher(String sIdentifier,
EventDispatcher dispatcher)
Introduce and possibly bind this
EventInterceptor to the
specified EventDispatcher . |
onEvent
void introduceEventDispatcher(String sIdentifier, EventDispatcher dispatcher)
EventInterceptor
to the
specified EventDispatcher
.
Note that EventInterceptors are responsible for determining
whether they should be registered with an EventDispatcher by calling
EventDispatcher.addEventInterceptor(com.tangosol.net.events.EventInterceptor<E>)
.
sIdentifier
- the unique name identifying this interceptordispatcher
- the dispatcher being introduced