public class CacheEventListenerConfigurationBuilder extends java.lang.Object implements Builder<CacheEventListenerConfiguration<?>>
CacheEventListenerConfigurationBuilder
enables building CacheEventListenerConfiguration
s using a
fluent style.
As with all Ehcache builders, all instances are immutable and calling any method on the builder will return a new instance without modifying the one on which the method was called. This enables the sharing of builder instances without any risk of seeing them modified by code elsewhere.
Modifier and Type | Method and Description |
---|---|
CacheEventListenerConfigurationBuilder |
asynchronous()
Sets the returned builder for asynchronous event processing.
|
org.ehcache.impl.config.event.DefaultCacheEventListenerConfiguration |
build()
Builds the
CacheEventListenerConfiguration this builder represents. |
CacheEventListenerConfigurationBuilder |
constructedWith(java.lang.Object... arguments)
Adds arguments that will be passed to the constructor of the
CacheEventListener subclass configured
previously. |
CacheEventListenerConfigurationBuilder |
eventOrdering(EventOrdering eventOrdering)
Adds specific
EventOrdering to the returned builder. |
CacheEventListenerConfigurationBuilder |
firingMode(EventFiring eventFiringMode)
Adds specific
EventFiring to the returned builder. |
static CacheEventListenerConfigurationBuilder |
newEventListenerConfiguration(CacheEventListener<?,?> listener,
EventType eventType,
EventType... eventTypes)
Creates a new builder instance using the given
CacheEventListener instance and the EventType s it
will listen to. |
static CacheEventListenerConfigurationBuilder |
newEventListenerConfiguration(CacheEventListener<?,?> listener,
java.util.Set<EventType> eventSetToFireOn)
Creates a new builder instance using the given
CacheEventListener instance and the set of EventType s
to listen to. |
static CacheEventListenerConfigurationBuilder |
newEventListenerConfiguration(java.lang.Class<? extends CacheEventListener<?,?>> listenerClass,
EventType eventType,
EventType... eventTypes)
Creates a new builder instance using the given
CacheEventListener subclass and the EventType s it
will listen to. |
static CacheEventListenerConfigurationBuilder |
newEventListenerConfiguration(java.lang.Class<? extends CacheEventListener<?,?>> listenerClass,
java.util.Set<EventType> eventSetToFireOn)
Creates a new builder instance using the given
CacheEventListener subclass and the set of EventType s
to listen to. |
CacheEventListenerConfigurationBuilder |
ordered()
Sets the returned builder for ordered event processing.
|
CacheEventListenerConfigurationBuilder |
synchronous()
Sets the returned builder for synchronous event processing.
|
CacheEventListenerConfigurationBuilder |
unordered()
Sets the returned builder for unordered event processing.
|
public static CacheEventListenerConfigurationBuilder newEventListenerConfiguration(java.lang.Class<? extends CacheEventListener<?,?>> listenerClass, EventType eventType, EventType... eventTypes)
CacheEventListener
subclass and the EventType
s it
will listen to.
EventOrdering
defaults to EventOrdering.UNORDERED
EventFiring
defaults to EventFiring.ASYNCHRONOUS
listenerClass
- the CacheEventListener
subclasseventType
- the mandatory event type to listen toeventTypes
- optional additional event types to listen topublic static CacheEventListenerConfigurationBuilder newEventListenerConfiguration(CacheEventListener<?,?> listener, EventType eventType, EventType... eventTypes)
CacheEventListener
instance and the EventType
s it
will listen to.
EventOrdering
defaults to EventOrdering.UNORDERED
EventFiring
defaults to EventFiring.ASYNCHRONOUS
listener
- the CacheEventListener
instanceeventType
- the mandatory event type to listen toeventTypes
- optional additional event types to listen topublic static CacheEventListenerConfigurationBuilder newEventListenerConfiguration(java.lang.Class<? extends CacheEventListener<?,?>> listenerClass, java.util.Set<EventType> eventSetToFireOn) throws java.lang.IllegalArgumentException
CacheEventListener
subclass and the set of EventType
s
to listen to.
EventOrdering
defaults to EventOrdering.UNORDERED
EventFiring
defaults to EventFiring.ASYNCHRONOUS
listenerClass
- the CacheEventListener
subclasseventSetToFireOn
- the set of events to listen to, cannot be emptyjava.lang.IllegalArgumentException
- if the eventSetToFireOn
is emptypublic static CacheEventListenerConfigurationBuilder newEventListenerConfiguration(CacheEventListener<?,?> listener, java.util.Set<EventType> eventSetToFireOn) throws java.lang.IllegalArgumentException
CacheEventListener
instance and the set of EventType
s
to listen to.
EventOrdering
defaults to EventOrdering.UNORDERED
EventFiring
defaults to EventFiring.ASYNCHRONOUS
listener
- the CacheEventListener
instanceeventSetToFireOn
- the set of events to listen to, cannot be emptyjava.lang.IllegalArgumentException
- if the eventSetToFireOn
is emptypublic CacheEventListenerConfigurationBuilder constructedWith(java.lang.Object... arguments)
CacheEventListener
subclass configured
previously.arguments
- the constructor argumentsjava.lang.IllegalArgumentException
- if this builder is instance basedpublic CacheEventListenerConfigurationBuilder eventOrdering(EventOrdering eventOrdering)
EventOrdering
to the returned builder.
EventOrdering
defaults to EventOrdering.UNORDERED
eventOrdering
- the EventOrdering
to useordered()
,
unordered()
public CacheEventListenerConfigurationBuilder ordered()
unordered()
,
eventOrdering(EventOrdering)
public CacheEventListenerConfigurationBuilder unordered()
ordered()
,
eventOrdering(EventOrdering)
public CacheEventListenerConfigurationBuilder firingMode(EventFiring eventFiringMode)
eventFiringMode
- the EventFiring
to usesynchronous()
,
asynchronous()
public CacheEventListenerConfigurationBuilder synchronous()
asynchronous()
,
firingMode(EventFiring)
public CacheEventListenerConfigurationBuilder asynchronous()
synchronous()
,
firingMode(EventFiring)
public org.ehcache.impl.config.event.DefaultCacheEventListenerConfiguration build()
CacheEventListenerConfiguration
this builder represents.build
in interface Builder<CacheEventListenerConfiguration<?>>
CacheEventListenerConfiguration