Class MutableCacheEntryListenerConfiguration<K,V>
java.lang.Object
javax.cache.configuration.MutableCacheEntryListenerConfiguration<K,V>
- Type Parameters:
K- the type of keys maintained the cacheV- the type of cached values
- All Implemented Interfaces:
Serializable, CacheEntryListenerConfiguration<K,V>
public class MutableCacheEntryListenerConfiguration<K,V>
extends Object
implements CacheEntryListenerConfiguration<K,V>
A convenience class providing a mutable, serializable implementation of a
CacheEntryListenerConfiguration.- Since:
- 1.0
- Author:
- Brian Oliver
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe serialVersionUID required forSerializable. -
Constructor Summary
ConstructorsConstructorDescriptionMutableCacheEntryListenerConfiguration(CacheEntryListenerConfiguration<K, V> configuration) Constructs aMutableCacheEntryListenerConfigurationbased on anotherCacheEntryListenerConfiguration.MutableCacheEntryListenerConfiguration(Factory<? extends CacheEntryListener<? super K, ? super V>> listenerFactory, Factory<? extends CacheEntryEventFilter<? super K, ? super V>> filterFactory, boolean isOldValueRequired, boolean isSynchronous) Constructs aMutableCacheEntryListenerConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionbooleanFactory<CacheEntryEventFilter<? super K, ? super V>> Obtains theFactoryfor theCacheEntryEventFilterthat should be applied prior to notifying theCacheEntryListener.Factory<CacheEntryListener<? super K, ? super V>> Obtains theFactoryfor theCacheEntryListener.inthashCode()booleanDetermines if the old value should be provided to theCacheEntryListener.booleanDetermines if the thread that caused an event to be created should be blocked (not return from the operation causing the event) until theCacheEntryListenerhas been notified.setCacheEntryEventFilterFactory(Factory<? extends CacheEntryEventFilter<? super K, ? super V>> filterFactory) Sets theFactoryto be used to create aCacheEntryEventFilter.setCacheEntryListenerFactory(Factory<? extends CacheEntryListener<? super K, ? super V>> listenerFactory) Sets theFactoryto be used to create aCacheEntryListener.setOldValueRequired(boolean isOldValueRequired) Sets if the old value should be provided to theCacheEntryListener.setSynchronous(boolean isSynchronous) Sets if the thread that causes an event should be blocked (not return from the operation causing the event) until theCacheEntryListenerhas been notified.
-
Field Details
-
serialVersionUID
-
-
Constructor Details
-
MutableCacheEntryListenerConfiguration
Constructs aMutableCacheEntryListenerConfigurationbased on anotherCacheEntryListenerConfiguration.- Parameters:
configuration- theCacheEntryListenerConfiguration
-
MutableCacheEntryListenerConfiguration
public MutableCacheEntryListenerConfiguration(Factory<? extends CacheEntryListener<? super K, ? super V>> listenerFactory, Factory<? extends CacheEntryEventFilter<? super K, ? super V>> filterFactory, boolean isOldValueRequired, boolean isSynchronous) Constructs aMutableCacheEntryListenerConfiguration.- Parameters:
listenerFactory- theCacheEntryListenerFactoryfilterFactory- the optionalCacheEntryEventFilterFactoryisOldValueRequired- if the old value is required for events with this listenerFactoryisSynchronous- if the listenerFactory should block the thread causing the event
-
-
Method Details
-
getCacheEntryListenerFactory
Obtains theFactoryfor theCacheEntryListener.- Specified by:
getCacheEntryListenerFactoryin interfaceCacheEntryListenerConfiguration<K,V> - Returns:
- the
Factoryfor theCacheEntryListener
-
setCacheEntryListenerFactory
public MutableCacheEntryListenerConfiguration<K,V> setCacheEntryListenerFactory(Factory<? extends CacheEntryListener<? super K, ? super V>> listenerFactory) Sets theFactoryto be used to create aCacheEntryListener.- Parameters:
listenerFactory- theFactory- Returns:
- the
MutableCacheEntryListenerConfigurationto permit fluent-style method calls
-
getCacheEntryEventFilterFactory
Obtains theFactoryfor theCacheEntryEventFilterthat should be applied prior to notifying theCacheEntryListener.When
nullno filtering is applied and all appropriate events are notified.- Specified by:
getCacheEntryEventFilterFactoryin interfaceCacheEntryListenerConfiguration<K,V> - Returns:
- the
Factoryfor theCacheEntryEventFilterornullif no filtering is required
-
setCacheEntryEventFilterFactory
public MutableCacheEntryListenerConfiguration<K,V> setCacheEntryEventFilterFactory(Factory<? extends CacheEntryEventFilter<? super K, ? super V>> filterFactory) Sets theFactoryto be used to create aCacheEntryEventFilter.- Parameters:
filterFactory- theFactory, ornullif event filtering is not requried- Returns:
- the
MutableCacheEntryListenerConfigurationto permit fluent-style method calls
-
isOldValueRequired
public boolean isOldValueRequired()Determines if the old value should be provided to theCacheEntryListener.- Specified by:
isOldValueRequiredin interfaceCacheEntryListenerConfiguration<K,V> - Returns:
trueif the old value is required by theCacheEntryListener
-
setOldValueRequired
Sets if the old value should be provided to theCacheEntryListener.- Parameters:
isOldValueRequired-trueif the old value is required- Returns:
- the
MutableCacheEntryListenerConfigurationto permit fluent-style method calls
-
isSynchronous
public boolean isSynchronous()Determines if the thread that caused an event to be created should be blocked (not return from the operation causing the event) until theCacheEntryListenerhas been notified.- Specified by:
isSynchronousin interfaceCacheEntryListenerConfiguration<K,V> - Returns:
trueif the thread that created the event should block
-
setSynchronous
Sets if the thread that causes an event should be blocked (not return from the operation causing the event) until theCacheEntryListenerhas been notified.- Parameters:
isSynchronous-truemeans block until notified- Returns:
- the
MutableCacheEntryListenerConfigurationto permit fluent-style method calls
-
hashCode
-
equals
-