|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Event
An Event
object captures the necessary information required to adequately describe some activity that has occurred.
Note that an Event
object itself is immutable and is only valid in the context of a single chain of EventInterceptor.onEvent(Event)
calls. Holding a reference to the Event
outside of that scope is not safe.
Method Summary | |
---|---|
java.lang.Enum |
getType() Return the Event 's type. |
void |
nextInterceptor() Dispatch this event to the next EventInterceptor in the chain if one exists. |
Method Detail |
---|
java.lang.Enum getType()
Event
's type.Event
's typevoid nextInterceptor() throws EventDeathException
EventInterceptor
in the chain if one exists. After each subsequent interceptor has run, this method will return giving the caller the opportunity to observe any side effects caused by down stream EventInterceptor
s. EventInterceptor
s that do not explicitly call this method will not prevent other interceptors from being executed, but rather will not have the opportunity to see any side effects of those interceptors.
In the following example an interceptor looks for an INSERTING storage event, and calls nextInterceptor()
. This allows "more application logic" to look at the effects of other interceptors down stream. If the event is not an INSERTING storage event, the interceptor is not interested in the side effects, and simply returns. public void onEvent(Event event) { if (event.getType() == StorageEntryEvent.INSERTING) { // application logic event.nextInterceptor(); // more application logic } return; }
If an EventDeathException is thrown by an interceptor's onEvent
method and this event is mutable, the processing of further interceptors will be terminated, the exception is re-thrown and the operation that generated the event will fail. If this event is immutable however, the exception will be caught and logged, and normal processing of subsequent interceptors will continue.
EventDeathException
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |