|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ehcache.events.CacheEventNotificationServiceImpl<K,V>
public class CacheEventNotificationServiceImpl<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 | |
|---|---|
CacheEventNotificationServiceImpl(java.util.concurrent.ExecutorService orderedDelivery,
java.util.concurrent.ExecutorService unorderedDelivery,
Store<K,V> store,
TimeSource timeSource)
|
|
| Method Summary | |
|---|---|
void |
deregisterCacheEventListener(CacheEventListener<? super K,? super V> listener)
Allows for deregistering of a previously registered CacheEventListener instance |
boolean |
hasListeners()
|
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 |
releaseAllListeners()
|
void |
setStoreListenerSource(Cache<K,V> source)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CacheEventNotificationServiceImpl(java.util.concurrent.ExecutorService orderedDelivery,
java.util.concurrent.ExecutorService unorderedDelivery,
Store<K,V> store,
TimeSource timeSource)
| 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 CacheEventNotificationService<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 CacheEventNotificationService<K,V>listener - the listener to deregister
java.lang.IllegalStateException - if the listener isn't already registeredpublic void releaseAllListeners()
releaseAllListeners in interface CacheEventNotificationService<K,V>public void setStoreListenerSource(Cache<K,V> source)
setStoreListenerSource in interface CacheEventNotificationService<K,V>public void onEvent(CacheEvent<K,V> event)
onEvent in interface CacheEventNotificationService<K,V>public boolean hasListeners()
hasListeners in interface CacheEventNotificationService<K,V>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||