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:
Serializable
,CacheEntryListenerConfiguration<K,V>
public class MutableCacheEntryListenerConfiguration<K,V> extends Object implements CacheEntryListenerConfiguration<K,V>
A convenience class providing a mutable, serializable implementation of aCacheEntryListenerConfiguration
.- Since:
- 1.0
- Author:
- Brian Oliver
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static long
serialVersionUID
The serialVersionUID required forSerializable
.
-
Constructor Summary
Constructors Constructor Description MutableCacheEntryListenerConfiguration(CacheEntryListenerConfiguration<K,V> configuration)
Constructs aMutableCacheEntryListenerConfiguration
based 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 boolean
equals(Object object)
Factory<CacheEntryEventFilter<? super K,? super V>>
getCacheEntryEventFilterFactory()
Obtains theFactory
for theCacheEntryEventFilter
that should be applied prior to notifying theCacheEntryListener
.Factory<CacheEntryListener<? super K,? super V>>
getCacheEntryListenerFactory()
Obtains theFactory
for theCacheEntryListener
.int
hashCode()
boolean
isOldValueRequired()
Determines if the old value should be provided to theCacheEntryListener
.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 theCacheEntryListener
has been notified.MutableCacheEntryListenerConfiguration<K,V>
setCacheEntryEventFilterFactory(Factory<? extends CacheEntryEventFilter<? super K,? super V>> filterFactory)
Sets theFactory
to be used to create aCacheEntryEventFilter
.MutableCacheEntryListenerConfiguration<K,V>
setCacheEntryListenerFactory(Factory<? extends CacheEntryListener<? super K,? super V>> listenerFactory)
Sets theFactory
to 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 theCacheEntryListener
has been notified.
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
The serialVersionUID required forSerializable
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MutableCacheEntryListenerConfiguration
public MutableCacheEntryListenerConfiguration(CacheEntryListenerConfiguration<K,V> configuration)
Constructs aMutableCacheEntryListenerConfiguration
based 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
- theCacheEntryListener
Factory
filterFactory
- the optionalCacheEntryEventFilter
Factory
isOldValueRequired
- 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 theFactory
for theCacheEntryListener
.- Specified by:
getCacheEntryListenerFactory
in interfaceCacheEntryListenerConfiguration<K,V>
- Returns:
- the
Factory
for theCacheEntryListener
-
setCacheEntryListenerFactory
public MutableCacheEntryListenerConfiguration<K,V> setCacheEntryListenerFactory(Factory<? extends CacheEntryListener<? super K,? super V>> listenerFactory)
Sets theFactory
to be used to create aCacheEntryListener
.- Parameters:
listenerFactory
- theFactory
- Returns:
- the
MutableCacheEntryListenerConfiguration
to permit fluent-style method calls
-
getCacheEntryEventFilterFactory
public Factory<CacheEntryEventFilter<? super K,? super V>> getCacheEntryEventFilterFactory()
Obtains theFactory
for theCacheEntryEventFilter
that should be applied prior to notifying theCacheEntryListener
.When
null
no filtering is applied and all appropriate events are notified.- Specified by:
getCacheEntryEventFilterFactory
in interfaceCacheEntryListenerConfiguration<K,V>
- Returns:
- the
Factory
for theCacheEntryEventFilter
ornull
if no filtering is required
-
setCacheEntryEventFilterFactory
public MutableCacheEntryListenerConfiguration<K,V> setCacheEntryEventFilterFactory(Factory<? extends CacheEntryEventFilter<? super K,? super V>> filterFactory)
Sets theFactory
to be used to create aCacheEntryEventFilter
.- Parameters:
filterFactory
- theFactory
, ornull
if event filtering is not requried- Returns:
- the
MutableCacheEntryListenerConfiguration
to permit fluent-style method calls
-
isOldValueRequired
public boolean isOldValueRequired()
Determines if the old value should be provided to theCacheEntryListener
.- Specified by:
isOldValueRequired
in interfaceCacheEntryListenerConfiguration<K,V>
- Returns:
true
if 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
-true
if the old value is required- Returns:
- the
MutableCacheEntryListenerConfiguration
to 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 theCacheEntryListener
has been notified.- Specified by:
isSynchronous
in interfaceCacheEntryListenerConfiguration<K,V>
- Returns:
true
if 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 theCacheEntryListener
has been notified.- Parameters:
isSynchronous
-true
means block until notified- Returns:
- the
MutableCacheEntryListenerConfiguration
to permit fluent-style method calls
-
-