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 a
CacheEntryListenerConfiguration
.- Since:
- 1.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Factory
<CacheEntryEventFilter<? super K, ? super V>> TheFactory
to be used to create theCacheEntryEventFilter
.private boolean
Is the old value required to be provide to theCacheEntryListener
?private boolean
Should theCacheEntryListener
be notified as part of an operation or is asynchronous delivery acceptable?private Factory
<CacheEntryListener<? super K, ? super V>> TheFactory
to be used to create theCacheEntryListener
.static final long
The serialVersionUID required forSerializable
. -
Constructor Summary
ConstructorsConstructorDescriptionMutableCacheEntryListenerConfiguration
(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
Modifier and TypeMethodDescriptionboolean
Factory
<CacheEntryEventFilter<? super K, ? super V>> Obtains theFactory
for theCacheEntryEventFilter
that should be applied prior to notifying theCacheEntryListener
.Factory
<CacheEntryListener<? super K, ? super V>> Obtains theFactory
for theCacheEntryListener
.int
hashCode()
boolean
Determines if the old value should be provided to theCacheEntryListener
.boolean
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.setCacheEntryEventFilterFactory
(Factory<? extends CacheEntryEventFilter<? super K, ? super V>> filterFactory) Sets theFactory
to be used to create aCacheEntryEventFilter
.setCacheEntryListenerFactory
(Factory<? extends CacheEntryListener<? super K, ? super V>> listenerFactory) Sets theFactory
to 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 theCacheEntryListener
has been notified.
-
Field Details
-
serialVersionUID
public static final long serialVersionUIDThe serialVersionUID required forSerializable
.- See Also:
-
listenerFactory
TheFactory
to be used to create theCacheEntryListener
. -
filterFactory
TheFactory
to be used to create theCacheEntryEventFilter
. (may be null if no filtering is required) -
isOldValueRequired
private boolean isOldValueRequiredIs the old value required to be provide to theCacheEntryListener
? -
isSynchronous
private boolean isSynchronousShould theCacheEntryListener
be notified as part of an operation or is asynchronous delivery acceptable?
-
-
Constructor Details
-
MutableCacheEntryListenerConfiguration
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 Details
-
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
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
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
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
-
hashCode
public int hashCode() -
equals
-