Package javax.cache.configuration
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:
java.io.Serializable,CacheEntryListenerConfiguration<K,V>
public class MutableCacheEntryListenerConfiguration<K,V> extends java.lang.Object implements CacheEntryListenerConfiguration<K,V>
A convenience class providing a mutable, serializable implementation of aCacheEntryListenerConfiguration.- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private Factory<CacheEntryEventFilter<? super K,? super V>>filterFactoryTheFactoryto be used to create theCacheEntryEventFilter.private booleanisOldValueRequiredIs the old value required to be provide to theCacheEntryListener?private booleanisSynchronousShould theCacheEntryListenerbe notified as part of an operation or is asynchronous delivery acceptable?private Factory<CacheEntryListener<? super K,? super V>>listenerFactoryTheFactoryto be used to create theCacheEntryListener.static longserialVersionUIDThe serialVersionUID required forSerializable.
-
Constructor Summary
Constructors Constructor Description MutableCacheEntryListenerConfiguration(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object object)Factory<CacheEntryEventFilter<? super K,? super V>>getCacheEntryEventFilterFactory()Obtains theFactoryfor theCacheEntryEventFilterthat should be applied prior to notifying theCacheEntryListener.Factory<CacheEntryListener<? super K,? super V>>getCacheEntryListenerFactory()Obtains theFactoryfor theCacheEntryListener.inthashCode()booleanisOldValueRequired()Determines if the old value should be provided to theCacheEntryListener.booleanisSynchronous()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.MutableCacheEntryListenerConfiguration<K,V>setCacheEntryEventFilterFactory(Factory<? extends CacheEntryEventFilter<? super K,? super V>> filterFactory)Sets theFactoryto be used to create aCacheEntryEventFilter.MutableCacheEntryListenerConfiguration<K,V>setCacheEntryListenerFactory(Factory<? extends CacheEntryListener<? super K,? super V>> listenerFactory)Sets theFactoryto be used to create aCacheEntryListener.MutableCacheEntryListenerConfiguration<K,V>setOldValueRequired(boolean isOldValueRequired)Sets if the old value should be provided to theCacheEntryListener.MutableCacheEntryListenerConfiguration<K,V>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 Detail
-
serialVersionUID
public static final long serialVersionUID
The serialVersionUID required forSerializable.- See Also:
- Constant Field Values
-
listenerFactory
private Factory<CacheEntryListener<? super K,? super V>> listenerFactory
TheFactoryto be used to create theCacheEntryListener.
-
filterFactory
private Factory<CacheEntryEventFilter<? super K,? super V>> filterFactory
TheFactoryto be used to create theCacheEntryEventFilter. (may be null if no filtering is required)
-
isOldValueRequired
private boolean isOldValueRequired
Is the old value required to be provide to theCacheEntryListener?
-
isSynchronous
private boolean isSynchronous
Should theCacheEntryListenerbe notified as part of an operation or is asynchronous delivery acceptable?
-
-
Constructor Detail
-
MutableCacheEntryListenerConfiguration
public MutableCacheEntryListenerConfiguration(CacheEntryListenerConfiguration<K,V> configuration)
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 Detail
-
getCacheEntryListenerFactory
public Factory<CacheEntryListener<? super K,? super V>> 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
public Factory<CacheEntryEventFilter<? super K,? super V>> 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
public MutableCacheEntryListenerConfiguration<K,V> setOldValueRequired(boolean isOldValueRequired)
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
public MutableCacheEntryListenerConfiguration<K,V> 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.- Parameters:
isSynchronous-truemeans block until notified- Returns:
- the
MutableCacheEntryListenerConfigurationto permit fluent-style method calls
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
-