|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ehcache.core.events.CacheEventDispatcherImpl<K,V>
public class CacheEventDispatcherImpl<K,V>
Per-cache component that manages cache event listener registrations, and provides event delivery based on desired firing mode and ordering, for specified event types.
onEvent(CacheEvent)
is assumed to be called within a key-based
lock scope. If that is not the case, this facility has no means of maintaining event ordering consistent with source
of such events. That is - listeners registered to receive events in the order they occurred in underlying store may be
invoked in an order inconsistent with actual ordering of corresponding operations on said store.
Conversely, sending events to this service inside lock scope, when there are no registered listeners interested in ordered event delivery is harmless, i.e. event delivery to unordered listeners will still occur.
Constructor Summary | |
---|---|
CacheEventDispatcherImpl(java.util.concurrent.ExecutorService unOrderedExectuor,
java.util.concurrent.ExecutorService orderedExecutor)
|
Method Summary | |
---|---|
void |
deregisterCacheEventListener(CacheEventListener<? super K,? super V> listener)
Allows for deregistering of a previously registered CacheEventListener instance |
java.util.List<CacheConfigurationChangeListener> |
getConfigurationChangeListeners()
get the List CacheConfigurationChangeListener defined in the Store |
void |
onEvent(CacheEvent<K,V> event)
|
void |
registerCacheEventListener(CacheEventListener<? super K,? super V> listener,
EventOrdering ordering,
EventFiring firing,
java.util.EnumSet<EventType> forEventTypes)
Allows for registering CacheEventListener on the cache |
void |
setListenerSource(Cache<K,V> source)
|
void |
setStoreEventSource(StoreEventSource<K,V> eventSource)
Sets StoreEventSource to enable eventing |
void |
shutdown()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CacheEventDispatcherImpl(java.util.concurrent.ExecutorService unOrderedExectuor, java.util.concurrent.ExecutorService orderedExecutor)
Method Detail |
---|
public void registerCacheEventListener(CacheEventListener<? super K,? super V> listener, EventOrdering ordering, EventFiring firing, java.util.EnumSet<EventType> forEventTypes)
CacheEventListener
on the cache
registerCacheEventListener
in interface CacheEventDispatcher<K,V>
listener
- the listener instance to registerordering
- the EventOrdering
to invoke this listenerfiring
- the EventFiring
to invoke this listenerforEventTypes
- the EventType
to notify this listener of
java.lang.IllegalStateException
- if the listener is already registeredpublic void deregisterCacheEventListener(CacheEventListener<? super K,? super V> listener)
CacheEventListener
instance
deregisterCacheEventListener
in interface CacheEventDispatcher<K,V>
listener
- the listener to deregister
java.lang.IllegalStateException
- if the listener isn't already registeredpublic void shutdown()
shutdown
in interface CacheEventDispatcher<K,V>
public void setListenerSource(Cache<K,V> source)
setListenerSource
in interface CacheEventDispatcher<K,V>
public void onEvent(CacheEvent<K,V> event)
public java.util.List<CacheConfigurationChangeListener> getConfigurationChangeListeners()
ConfigurationChangeSupport
List
CacheConfigurationChangeListener
defined in the Store
getConfigurationChangeListeners
in interface ConfigurationChangeSupport
CacheConfigurationChangeListener
public void setStoreEventSource(StoreEventSource<K,V> eventSource)
StoreEventSource
to enable eventing
setStoreEventSource
in interface CacheEventDispatcher<K,V>
eventSource
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |