Top Description Fields Constructors Methods
javax.cache.configuration

public Class MutableCacheEntryListenerConfiguration<K, V>

extends Object
implements CacheEntryListenerConfiguration<K, V>
Class Inheritance
All Implemented Interfaces
javax.cache.configuration.CacheEntryListenerConfiguration, java.io.Serializable
Type Parameters
<K>
the type of keys maintained the cache
<V>
the type of cached values
Imports
javax.cache.event.CacheEntryEventFilter, .CacheEntryListener

A convenience class providing a mutable, serializable implementation of a CacheEntryListenerConfiguration.
Author
Brian Oliver
Since
1.0

Field Summary

Modifier and TypeField and Description
private Factory<CacheEntryEventFilter<? super K, ? super V>>
filterFactory

The Factory to be used to create the CacheEntryEventFilter.

private boolean
isOldValueRequired

Is the old value required to be provide to the CacheEntryListener?

private boolean
isSynchronous

Should the CacheEntryListener be notified as part of an operation or is asynchronous delivery acceptable?

private Factory<CacheEntryListener<? super K, ? super V>>
listenerFactory

The Factory to be used to create the CacheEntryListener.

public static final long
serialVersionUID

The serialVersionUID required for java.io.Serializable.

Constructor Summary

AccessConstructor and Description
public
public
MutableCacheEntryListenerConfiguration(Factory<? extends CacheEntryListener<? super K, ? super V>> listenerFactory, Factory<? extends CacheEntryEventFilter<? super K, ? super V>> filterFactory, boolean
if the old value is required for events with this listenerFactory
isOldValueRequired
,
boolean
if the listenerFactory should block the thread causing the event
isSynchronous
)

Constructs a MutableCacheEntryListenerConfiguration.

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
object
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public Factory<CacheEntryEventFilter<? super K, ? super V>>
public Factory<CacheEntryListener<? super K, ? super V>>
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
public boolean
isSynchronous()

Implements javax.cache.configuration.CacheEntryListenerConfiguration.isSynchronous.

Determines if the thread that caused an event to be created should be blocked (not return from the operation causing the event) until the CacheEntryListener has been notified.
public MutableCacheEntryListenerConfiguration<K, V>

Returns:

the MutableCacheEntryListenerConfiguration to permit fluent-style method calls
setCacheEntryEventFilterFactory
(Factory<? extends CacheEntryEventFilter<? super K, ? super V>>
the Factory, or null if event filtering is not requried
filterFactory
)

Sets the Factory to be used to create a CacheEntryEventFilter.

public MutableCacheEntryListenerConfiguration<K, V>

Returns:

the MutableCacheEntryListenerConfiguration to permit fluent-style method calls
setCacheEntryListenerFactory
(Factory<? extends CacheEntryListener<? super K, ? super V>> listenerFactory)

Sets the Factory to be used to create a CacheEntryListener.

public MutableCacheEntryListenerConfiguration<K, V>

Returns:

the MutableCacheEntryListenerConfiguration to permit fluent-style method calls
setOldValueRequired
(boolean
true if the old value is required
isOldValueRequired
)

Sets if the old value should be provided to the CacheEntryListener.

public MutableCacheEntryListenerConfiguration<K, V>

Returns:

the MutableCacheEntryListenerConfiguration to permit fluent-style method calls
setSynchronous
(boolean
true means block until notified
isSynchronous
)

Sets if the thread that causes an event should be blocked (not return from the operation causing the event) until the CacheEntryListener has been notified.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

filterFactoryback to summary
private Factory<CacheEntryEventFilter<? super K, ? super V>> filterFactory

The Factory to be used to create the CacheEntryEventFilter. (may be null if no filtering is required)

isOldValueRequiredback to summary
private boolean isOldValueRequired

Is the old value required to be provide to the CacheEntryListener?

isSynchronousback to summary
private boolean isSynchronous

Should the CacheEntryListener be notified as part of an operation or is asynchronous delivery acceptable?

listenerFactoryback to summary
private Factory<CacheEntryListener<? super K, ? super V>> listenerFactory

The Factory to be used to create the CacheEntryListener.

serialVersionUIDback to summary
public static final long serialVersionUID

The serialVersionUID required for java.io.Serializable.

Constructor Detail

MutableCacheEntryListenerConfigurationback to summary
public MutableCacheEntryListenerConfiguration(CacheEntryListenerConfiguration<K, V> configuration)

Constructs a MutableCacheEntryListenerConfiguration based on another CacheEntryListenerConfiguration.

Parameters
configuration:CacheEntryListenerConfiguration<K, V>

the CacheEntryListenerConfiguration

MutableCacheEntryListenerConfigurationback to summary
public MutableCacheEntryListenerConfiguration(Factory<? extends CacheEntryListener<? super K, ? super V>> listenerFactory, Factory<? extends CacheEntryEventFilter<? super K, ? super V>> filterFactory, boolean isOldValueRequired, boolean isSynchronous)

Constructs a MutableCacheEntryListenerConfiguration.

Parameters
listenerFactory:Factory<? extends CacheEntryListener<? super K, ? super V>>

the CacheEntryListener Factory

filterFactory:Factory<? extends CacheEntryEventFilter<? super K, ? super V>>

the optional CacheEntryEventFilter Factory

isOldValueRequired:boolean

if the old value is required for events with this listenerFactory

isSynchronous:boolean

if the listenerFactory should block the thread causing the event

Method Detail

equalsback to summary
public boolean equals(Object object)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
object:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getCacheEntryEventFilterFactoryback to summary
public Factory<CacheEntryEventFilter<? super K, ? super V>> getCacheEntryEventFilterFactory()

Implements javax.cache.configuration.CacheEntryListenerConfiguration.getCacheEntryEventFilterFactory.

Doc from javax.cache.configuration.CacheEntryListenerConfiguration.getCacheEntryEventFilterFactory.

Obtains the Factory for the CacheEntryEventFilter that should be applied prior to notifying the CacheEntryListener.

When null no filtering is applied and all appropriate events are notified.

Returns:Factory<CacheEntryEventFilter<? super K, ? super V>>

the Factory for the CacheEntryEventFilter or null if no filtering is required

Annotations
@Override
getCacheEntryListenerFactoryback to summary
public Factory<CacheEntryListener<? super K, ? super V>> getCacheEntryListenerFactory()

Implements javax.cache.configuration.CacheEntryListenerConfiguration.getCacheEntryListenerFactory.

Doc from javax.cache.configuration.CacheEntryListenerConfiguration.getCacheEntryListenerFactory.

Obtains the Factory for the CacheEntryListener.

Returns:Factory<CacheEntryListener<? super K, ? super V>>

the Factory for the CacheEntryListener

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
isOldValueRequiredback to summary
public boolean isOldValueRequired()

Implements javax.cache.configuration.CacheEntryListenerConfiguration.isOldValueRequired.

Doc from javax.cache.configuration.CacheEntryListenerConfiguration.isOldValueRequired.

Determines if the old value should be provided to the CacheEntryListener.

Returns:boolean

true if the old value is required by the CacheEntryListener

Annotations
@Override
isSynchronousback to summary
public boolean isSynchronous()

Implements javax.cache.configuration.CacheEntryListenerConfiguration.isSynchronous.

Doc from javax.cache.configuration.CacheEntryListenerConfiguration.isSynchronous.

Determines if the thread that caused an event to be created should be blocked (not return from the operation causing the event) until the CacheEntryListener has been notified.

Returns:boolean

true if the thread that created the event should block

Annotations
@Override
setCacheEntryEventFilterFactoryback to summary
public MutableCacheEntryListenerConfiguration<K, V> setCacheEntryEventFilterFactory(Factory<? extends CacheEntryEventFilter<? super K, ? super V>> filterFactory)

Sets the Factory to be used to create a CacheEntryEventFilter.

Parameters
filterFactory:Factory<? extends CacheEntryEventFilter<? super K, ? super V>>

the Factory, or null if event filtering is not requried

Returns:MutableCacheEntryListenerConfiguration<K, V>

the MutableCacheEntryListenerConfiguration to permit fluent-style method calls

setCacheEntryListenerFactoryback to summary
public MutableCacheEntryListenerConfiguration<K, V> setCacheEntryListenerFactory(Factory<? extends CacheEntryListener<? super K, ? super V>> listenerFactory)

Sets the Factory to be used to create a CacheEntryListener.

Parameters
listenerFactory:Factory<? extends CacheEntryListener<? super K, ? super V>>

the Factory

Returns:MutableCacheEntryListenerConfiguration<K, V>

the MutableCacheEntryListenerConfiguration to permit fluent-style method calls

setOldValueRequiredback to summary
public MutableCacheEntryListenerConfiguration<K, V> setOldValueRequired(boolean isOldValueRequired)

Sets if the old value should be provided to the CacheEntryListener.

Parameters
isOldValueRequired:boolean

true if the old value is required

Returns:MutableCacheEntryListenerConfiguration<K, V>

the MutableCacheEntryListenerConfiguration to permit fluent-style method calls

setSynchronousback to summary
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 the CacheEntryListener has been notified.

Parameters
isSynchronous:boolean

true means block until notified

Returns:MutableCacheEntryListenerConfiguration<K, V>

the MutableCacheEntryListenerConfiguration to permit fluent-style method calls