org.ehcache.core.events
Interface StoreEventDispatcher<K,V>

All Superinterfaces:
StoreEventSource<K,V>

public interface StoreEventDispatcher<K,V>
extends StoreEventSource<K,V>

Part of the events subsystem at the Store level.

This interface controls the lifecycle of StoreEventSinks, enabling implementations to decouple the event raising inside the Store from the firing to outside collaborators.

Store implementations are expected to get a StoreEventSink per operation and release it once the operation completes.


Method Summary
 StoreEventSink<K,V> eventSink()
          Hands over an event sink for recording store events.
 void releaseEventSink(StoreEventSink<K,V> eventSink)
          Releases the event sink after normal completion of an operation.
 void releaseEventSinkAfterFailure(StoreEventSink<K,V> eventSink, java.lang.Throwable throwable)
          Releases the event sink after failure of an operation.
 
Methods inherited from interface org.ehcache.core.spi.cache.events.StoreEventSource
addEventFilter, addEventListener, isEventOrdering, removeEventListener, setEventOrdering
 

Method Detail

eventSink

StoreEventSink<K,V> eventSink()
Hands over an event sink for recording store events.

Returns:
the event sink to use

releaseEventSink

void releaseEventSink(StoreEventSink<K,V> eventSink)
Releases the event sink after normal completion of an operation.

Parameters:
eventSink - the event sink to release

releaseEventSinkAfterFailure

void releaseEventSinkAfterFailure(StoreEventSink<K,V> eventSink,
                                  java.lang.Throwable throwable)
Releases the event sink after failure of an operation.

Parameters:
eventSink - the event sink to release
throwable - the exception