K
- the type of key.V
- the type of value.public class CacheEventListenerAdaptor<K,V> extends Object implements CacheEventListener, CacheEntryListenerProvider<K,V>
CacheEventListener
uses the adapter pattern for wrapping all cache event listener
types into a single listener.
JCache has multiple CacheEntryListener
sub-interfaces for each event type. This adapter
implementation delegates to the correct subtype using the event type.
Another responsibility of this implementation is filtering events by using the already configured event filters.
CacheEntryCreatedListener
,
CacheEntryUpdatedListener
,
CacheEntryRemovedListener
,
CacheEntryExpiredListener
,
CacheEntryEventFilter
Constructor and Description |
---|
CacheEventListenerAdaptor(ICache<K,V> source,
javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration,
SerializationService serializationService) |
Modifier and Type | Method and Description |
---|---|
javax.cache.event.CacheEntryListener<K,V> |
getCacheEntryListener()
Gets wrapped
CacheEntryListener |
void |
handleEvent(Object eventObject)
Cache Event handling function.
|
public javax.cache.event.CacheEntryListener<K,V> getCacheEntryListener()
CacheEntryListenerProvider
CacheEntryListener
getCacheEntryListener
in interface CacheEntryListenerProvider<K,V>
CacheEntryListener
public void handleEvent(Object eventObject)
CacheEventListener
handleEvent
in interface CacheEventListener
eventObject
- Event data object, can be one of CacheEventSet
or CacheEventData
classes.Event Types that can be handled.
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.