public class DefaultCacheEventListenerConfiguration extends org.ehcache.impl.internal.classes.ClassInstanceConfiguration<CacheEventListener<?,?>> implements CacheEventListenerConfiguration<java.lang.Void>
ServiceConfiguration
for the default CacheEventListenerProvider
.
Enables configuring a CacheEventListener
for a given cache.
This class overrides the default ServiceConfiguration.compatibleWith(ServiceConfiguration)
implementation
to allow for the configuration of multiple cache event listeners on the same cache.
Constructor and Description |
---|
DefaultCacheEventListenerConfiguration(java.util.Set<EventType> fireOn,
CacheEventListener<?,?> listener)
Creates a new
DefaultCacheEventListenerConfiguration with the provided parameters. |
DefaultCacheEventListenerConfiguration(java.util.Set<EventType> fireOn,
java.lang.Class<? extends CacheEventListener<?,?>> clazz,
java.lang.Object... arguments)
Creates a new
DefaultCacheEventListenerConfiguration with the provided parameters. |
Modifier and Type | Method and Description |
---|---|
boolean |
compatibleWith(ServiceConfiguration<?,?> other)
Returns true if this configuration can co-exist with
other in the same cache configuration. |
java.util.EnumSet<EventType> |
fireOn()
Indicates on which
EventType an event has to be fired |
EventFiring |
firingMode()
Indicates which
firing mode to use |
java.lang.Class<CacheEventListenerProvider> |
getServiceType()
Indicates which service this configuration works with.
|
EventOrdering |
orderingMode()
Indicates which
ordering mode to use |
void |
setEventFiringMode(EventFiring firingMode)
Sets the event firing mode on this configuration object.
|
void |
setEventOrderingMode(EventOrdering orderingMode)
Sets the event orderign mode on this configuration object.
|
getArguments, getClazz, getInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
build, derive
public DefaultCacheEventListenerConfiguration(java.util.Set<EventType> fireOn, java.lang.Class<? extends CacheEventListener<?,?>> clazz, java.lang.Object... arguments)
DefaultCacheEventListenerConfiguration
with the provided parameters.
EventFiring.ASYNCHRONOUS
EventOrdering.UNORDERED
fireOn
- the events to fire onclazz
- the cache event listener classarguments
- optional constructor argumentssetEventFiringMode(EventFiring)
,
setEventOrderingMode(EventOrdering)
public DefaultCacheEventListenerConfiguration(java.util.Set<EventType> fireOn, CacheEventListener<?,?> listener)
DefaultCacheEventListenerConfiguration
with the provided parameters.
EventFiring.ASYNCHRONOUS
EventOrdering.UNORDERED
fireOn
- the events to fire onlistener
- the cache event listener instancesetEventFiringMode(EventFiring)
,
setEventOrderingMode(EventOrdering)
public java.lang.Class<CacheEventListenerProvider> getServiceType()
getServiceType
in interface ServiceConfiguration<CacheEventListenerProvider,java.lang.Void>
public void setEventFiringMode(EventFiring firingMode)
firingMode
- the event firing modepublic void setEventOrderingMode(EventOrdering orderingMode)
orderingMode
- the event ordering modepublic EventFiring firingMode()
firing mode
to usefiringMode
in interface CacheEventListenerConfiguration<java.lang.Void>
public EventOrdering orderingMode()
ordering mode
to useorderingMode
in interface CacheEventListenerConfiguration<java.lang.Void>
public java.util.EnumSet<EventType> fireOn()
EventType
an event has to be firedfireOn
in interface CacheEventListenerConfiguration<java.lang.Void>
EventType
to fire onpublic boolean compatibleWith(ServiceConfiguration<?,?> other)
ServiceConfiguration
other
in the same cache configuration.
The default implementation of compatibleWith
(as used by many of the implementations) considers any
instance of the same type (or a sub-type) to be incompatible with this instance.
compatibleWith
in interface ServiceConfiguration<CacheEventListenerProvider,java.lang.Void>
other
- other service configurationtrue
if the two configurations are compatible