org.ehcache.config.builders
Class CacheEventListenerConfigurationBuilder

java.lang.Object
  extended by org.ehcache.config.builders.CacheEventListenerConfigurationBuilder
All Implemented Interfaces:
Builder<CacheEventListenerConfiguration>

public class CacheEventListenerConfigurationBuilder
extends java.lang.Object
implements Builder<CacheEventListenerConfiguration>

The CacheEventListenerConfigurationBuilder enables building CacheEventListenerConfigurations 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.


Method Summary
 CacheEventListenerConfigurationBuilder asynchronous()
          Sets the returned builder for asynchronous event processing.
 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 EventTypes 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 EventTypes 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 EventTypes 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 EventTypes 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newEventListenerConfiguration

public 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 EventTypes it will listen to.

Parameters:
listenerClass - the CacheEventListener subclass
eventType - the mandatory event type to listen to
eventTypes - optional additional event types to listen to
Returns:
the new builder instance

newEventListenerConfiguration

public static CacheEventListenerConfigurationBuilder newEventListenerConfiguration(CacheEventListener<?,?> listener,
                                                                                   EventType eventType,
                                                                                   EventType... eventTypes)
Creates a new builder instance using the given CacheEventListener instance and the EventTypes it will listen to.

Parameters:
listener - the CacheEventListener instance
eventType - the mandatory event type to listen to
eventTypes - optional additional event types to listen to
Returns:
the new builder instance

newEventListenerConfiguration

public static CacheEventListenerConfigurationBuilder newEventListenerConfiguration(java.lang.Class<? extends CacheEventListener<?,?>> listenerClass,
                                                                                   java.util.Set<EventType> eventSetToFireOn)
                                                                            throws java.lang.IllegalArgumentException
Creates a new builder instance using the given CacheEventListener subclass and the set of EventTypes to listen to.

Parameters:
listenerClass - the CacheEventListener subclass
eventSetToFireOn - the set of events to listen to, cannot be empty
Returns:
the new builder instance
Throws:
java.lang.IllegalArgumentException - if the eventSetToFireOn is empty

newEventListenerConfiguration

public static CacheEventListenerConfigurationBuilder newEventListenerConfiguration(CacheEventListener<?,?> listener,
                                                                                   java.util.Set<EventType> eventSetToFireOn)
                                                                            throws java.lang.IllegalArgumentException
Creates a new builder instance using the given CacheEventListener instance and the set of EventTypes to listen to.

Parameters:
listener - the CacheEventListener instance
eventSetToFireOn - the set of events to listen to, cannot be empty
Returns:
the new builder instance
Throws:
java.lang.IllegalArgumentException - if the eventSetToFireOn is empty

constructedWith

public CacheEventListenerConfigurationBuilder constructedWith(java.lang.Object... arguments)
Adds arguments that will be passed to the constructor of the CacheEventListener subclass configured previously.

Parameters:
arguments - the constructor arguments
Returns:
a new builder with the added constructor arguments
Throws:
java.lang.IllegalArgumentException - if this builder is instance based

eventOrdering

public CacheEventListenerConfigurationBuilder eventOrdering(EventOrdering eventOrdering)
Adds specific EventOrdering to the returned builder.

Parameters:
eventOrdering - the EventOrdering to use
Returns:
a new builder with the specified event ordering
See Also:
ordered(), unordered()

ordered

public CacheEventListenerConfigurationBuilder ordered()
Sets the returned builder for ordered event processing.

Returns:
a new builder for ordered processing
See Also:
unordered(), eventOrdering(EventOrdering)

unordered

public CacheEventListenerConfigurationBuilder unordered()
Sets the returned builder for unordered event processing.

Returns:
a new builder for unordered processing
See Also:
ordered(), eventOrdering(EventOrdering)

firingMode

public CacheEventListenerConfigurationBuilder firingMode(EventFiring eventFiringMode)
Adds specific EventFiring to the returned builder.

Parameters:
eventFiringMode - the EventFiring to use
Returns:
a new builder with the specified event firing
See Also:
synchronous(), asynchronous()

synchronous

public CacheEventListenerConfigurationBuilder synchronous()
Sets the returned builder for synchronous event processing.

Returns:
a new builder for synchronous processing
See Also:
asynchronous(), firingMode(EventFiring)

asynchronous

public CacheEventListenerConfigurationBuilder asynchronous()
Sets the returned builder for asynchronous event processing.

Returns:
a new builder for asynchronous processing
See Also:
synchronous(), firingMode(EventFiring)

build

public DefaultCacheEventListenerConfiguration build()
Builds the CacheEventListenerConfiguration this builder represents.

Specified by:
build in interface Builder<CacheEventListenerConfiguration>
Returns:
the CacheEventListenerConfiguration