org.ehcache.impl.internal.events
Class ScopedStoreEventDispatcher<K,V>

java.lang.Object
  extended by org.ehcache.impl.internal.events.ScopedStoreEventDispatcher<K,V>
All Implemented Interfaces:
StoreEventDispatcher<K,V>, StoreEventSource<K,V>

public class ScopedStoreEventDispatcher<K,V>
extends java.lang.Object

ScopedStoreEventDispatcher


Field Summary
protected static StoreEventSink NO_OP_EVENT_SINK
           
 
Constructor Summary
ScopedStoreEventDispatcher(int orderedEventParallelism)
           
 
Method Summary
 void addEventFilter(StoreEventFilter<K,V> eventFilter)
          Adds an event filter.
 void addEventListener(StoreEventListener<K,V> eventListener)
           
 StoreEventSink<K,V> eventSink()
           
protected  java.util.Set<StoreEventFilter<K,V>> getFilters()
           
protected  java.util.Set<StoreEventListener<K,V>> getListeners()
           
protected  java.util.concurrent.BlockingQueue<org.ehcache.impl.internal.events.FireableStoreEventHolder<K,V>>[] getOrderedQueues()
           
 boolean isEventOrdering()
          Indicates if the current store is delivering events ordered or not.
 void releaseEventSink(StoreEventSink<K,V> eventSink)
           
 void releaseEventSinkAfterFailure(StoreEventSink<K,V> eventSink, java.lang.Throwable throwable)
           
 void removeEventListener(StoreEventListener<K,V> eventListener)
           
 void setEventOrdering(boolean ordering)
          Toggles event ordering, which means events will respect ordering of operations on a key basis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_OP_EVENT_SINK

protected static final StoreEventSink NO_OP_EVENT_SINK
Constructor Detail

ScopedStoreEventDispatcher

public ScopedStoreEventDispatcher(int orderedEventParallelism)
Method Detail

eventSink

public StoreEventSink<K,V> eventSink()

getListeners

protected java.util.Set<StoreEventListener<K,V>> getListeners()

getFilters

protected java.util.Set<StoreEventFilter<K,V>> getFilters()

getOrderedQueues

protected java.util.concurrent.BlockingQueue<org.ehcache.impl.internal.events.FireableStoreEventHolder<K,V>>[] getOrderedQueues()

addEventListener

public void addEventListener(StoreEventListener<K,V> eventListener)
Specified by:
addEventListener in interface StoreEventSource<K,V>

removeEventListener

public void removeEventListener(StoreEventListener<K,V> eventListener)
Specified by:
removeEventListener in interface StoreEventSource<K,V>

addEventFilter

public void addEventFilter(StoreEventFilter<K,V> eventFilter)
Description copied from interface: StoreEventSource
Adds an event filter. When multiple event filters are added, an event must be accepted by all to be valid.

Specified by:
addEventFilter in interface StoreEventSource<K,V>
Parameters:
eventFilter - the event filter

setEventOrdering

public void setEventOrdering(boolean ordering)
Description copied from interface: StoreEventSource
Toggles event ordering, which means events will respect ordering of operations on a key basis.

Specified by:
setEventOrdering in interface StoreEventSource<K,V>
Parameters:
ordering - true if ordering is desired, false for no ordering

isEventOrdering

public boolean isEventOrdering()
Description copied from interface: StoreEventSource
Indicates if the current store is delivering events ordered or not.

Specified by:
isEventOrdering in interface StoreEventSource<K,V>
Returns:
true if ordering is on, false otherwise

releaseEventSink

public void releaseEventSink(StoreEventSink<K,V> eventSink)
Specified by:
releaseEventSink in interface StoreEventDispatcher<K,V>

releaseEventSinkAfterFailure

public void releaseEventSinkAfterFailure(StoreEventSink<K,V> eventSink,
                                         java.lang.Throwable throwable)
Specified by:
releaseEventSinkAfterFailure in interface StoreEventDispatcher<K,V>