Class EventTypeAwareListener<K,V>
- java.lang.Object
-
- com.github.benmanes.caffeine.jcache.event.EventTypeAwareListener<K,V>
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.util.EventListener,javax.cache.event.CacheEntryCreatedListener<K,V>,javax.cache.event.CacheEntryExpiredListener<K,V>,javax.cache.event.CacheEntryListener<K,V>,javax.cache.event.CacheEntryRemovedListener<K,V>,javax.cache.event.CacheEntryUpdatedListener<K,V>
final class EventTypeAwareListener<K,V> extends java.lang.Object implements javax.cache.event.CacheEntryCreatedListener<K,V>, javax.cache.event.CacheEntryUpdatedListener<K,V>, javax.cache.event.CacheEntryRemovedListener<K,V>, javax.cache.event.CacheEntryExpiredListener<K,V>, java.io.CloseableA decorator that dispatches the event iff the listener supports that action.
-
-
Constructor Summary
Constructors Constructor Description EventTypeAwareListener(javax.cache.event.CacheEntryListener<? super K,? super V> listener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voiddispatch(@NonNull JCacheEntryEvent<K,V> event)Processes the event and logs if an exception is thrown.booleanisCompatible(@NonNull javax.cache.event.EventType eventType)Returns if the backing listener consumes this type of event.voidonCreated(java.lang.Iterable<javax.cache.event.CacheEntryEvent<? extends K,? extends V>> events)voidonExpired(java.lang.Iterable<javax.cache.event.CacheEntryEvent<? extends K,? extends V>> events)voidonRemoved(java.lang.Iterable<javax.cache.event.CacheEntryEvent<? extends K,? extends V>> events)voidonUpdated(java.lang.Iterable<javax.cache.event.CacheEntryEvent<? extends K,? extends V>> events)
-
-
-
Method Detail
-
isCompatible
public boolean isCompatible(@NonNull javax.cache.event.EventType eventType)
Returns if the backing listener consumes this type of event.
-
dispatch
public void dispatch(@NonNull JCacheEntryEvent<K,V> event)
Processes the event and logs if an exception is thrown.
-
onCreated
public void onCreated(java.lang.Iterable<javax.cache.event.CacheEntryEvent<? extends K,? extends V>> events)
-
onUpdated
public void onUpdated(java.lang.Iterable<javax.cache.event.CacheEntryEvent<? extends K,? extends V>> events)
-
onRemoved
public void onRemoved(java.lang.Iterable<javax.cache.event.CacheEntryEvent<? extends K,? extends V>> events)
-
onExpired
public void onExpired(java.lang.Iterable<javax.cache.event.CacheEntryEvent<? extends K,? extends V>> events)
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-