Interface Configurer
- All Superinterfaces:
LifecycleOperations
- All Known Implementing Classes:
DefaultConfigurer,SpringConfigurer
Using DefaultConfigurer.defaultConfiguration(), you will get a Configurer instance with default components
configured. You will need to register your Aggregates (using configureAggregate(AggregateConfiguration) and
provide a repository implementation for each of them, or if you wish to use event sourcing, register your aggregates
through configureAggregate(Class) and configure an Event Store (configureEventStore(Function) or
configureEmbeddedEventStore(Function)).
- Since:
- 3.0
- Author:
- Allard Buijze
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the completely initialized Configuration built using this configurer.default <A> ConfigurerconfigureAggregate(Class<A> aggregate) Configures an Aggregate using default settings.<A> ConfigurerconfigureAggregate(AggregateConfiguration<A> aggregateConfiguration) Configures an Aggregate in this configuration based on the givenaggregateConfiguration.default ConfigurerconfigureCommandBus(Function<Configuration, CommandBus> commandBusBuilder) Configures the given Command Bus to use in this configuration.configureCorrelationDataProviders(Function<Configuration, List<CorrelationDataProvider>> correlationDataProviderBuilder) Configures the CorrelationDataProviders that Message processing components should use to attach correlation data to outgoing messages.default ConfigurerconfigureDeadlineManager(Function<Configuration, DeadlineManager> deadlineManagerBuilder) Registers aDeadlineManagerinstance with thisConfigurer.configureEmbeddedEventStore(Function<Configuration, EventStorageEngine> storageEngineBuilder) Configures an Embedded Event Store which uses the given Event Storage Engine to store its events.default ConfigurerconfigureEventBus(Function<Configuration, EventBus> eventBusBuilder) Configures the given Event Bus to use in this configuration.configureEventSerializer(Function<Configuration, Serializer> eventSerializerBuilder) Configures the given event Serializer to use in this configuration.default ConfigurerconfigureEventStore(Function<Configuration, EventStore> eventStoreBuilder) Configures the given Event Store to use in this configuration.default ConfigurerconfigureLifecyclePhaseTimeout(long timeout, TimeUnit timeUnit) Configures the timeout of each lifecycle phase.default ConfigurerconfigureMessageMonitor(Class<?> componentType, String componentName, Function<Configuration, MessageMonitor<Message<?>>> messageMonitorBuilder) Configures the builder function to create the Message Monitor for the Message processing components in this configuration that match the given class and name.configureMessageMonitor(Class<?> componentType, String componentName, MessageMonitorFactory messageMonitorFactory) Configures the factory create the Message Monitor for those Message processing components in this configuration that match the given class and name.default ConfigurerconfigureMessageMonitor(Class<?> componentType, Function<Configuration, MessageMonitor<Message<?>>> messageMonitorBuilder) Configures the builder function to create the Message Monitor for the Message processing components in this configuration that match the given componentType, unless more specific configuration based on both type and name is available.configureMessageMonitor(Class<?> componentType, MessageMonitorFactory messageMonitorFactory) Configures the factory to create the Message Monitor for the Message processing components in this configuration that match the given componentType, unless more specific configuration based on both type and name is available.configureMessageMonitor(Function<Configuration, BiFunction<Class<?>, String, MessageMonitor<Message<?>>>> messageMonitorFactoryBuilder) Configures the Message Monitor to use for the Message processing components in this configuration, unless more specific configuration based on the component's type, or type and name is available.configureMessageSerializer(Function<Configuration, Serializer> messageSerializerBuilder) Configures the given event Serializer to use in this configuration.default ConfigurerconfigureQueryBus(Function<Configuration, QueryBus> queryBusBuilder) Configures the given Query Bus to use in this configuration.default ConfigurerconfigureQueryUpdateEmitter(Function<Configuration, QueryUpdateEmitter> queryUpdateEmitterBuilder) Configures the given Query Update Emitter to use in this configuration.default ConfigurerconfigureResourceInjector(Function<Configuration, ResourceInjector> resourceInjectorBuilder) Configures the given Resource Injector to use for Sagas in this configuration.default ConfigurerconfigureSerializer(Function<Configuration, Serializer> serializerBuilder) Configures the given Serializer to use in this configuration.default ConfigurerconfigureSnapshotter(Function<Configuration, Snapshotter> snapshotterBuilder) Registers aSnapshotterinstance with thisConfigurer.default ConfigurerconfigureSpanFactory(Function<Configuration, SpanFactory> spanFactory) Registers aSpanFactoryinstance with thisConfigurer.default ConfigurerconfigureTags(Function<Configuration, TagsConfiguration> tagsBuilder) Configures the given Tags Configuration to use in this configuration.default ConfigurerconfigureTransactionManager(Function<Configuration, TransactionManager> transactionManagerBuilder) Configures the given Transaction Manager to use in this configuration.Retrieve theEventProcessingConfigurerregistered as a module with this Configurer.default ConfigurereventProcessing(Consumer<EventProcessingConfigurer> eventProcessingConfigurer) Locates theEventProcessingConfigurerregistered as a module with this Configurer and provides it to the given consumer for configuration.default voidonInitialize(Consumer<Configuration> initHandler) Register an initialization handler which should be invoked prior to starting thisConfigurer.default ConfigurerregisterCommandHandler(int phase, Function<Configuration, Object> commandHandlerBuilder) Deprecated.registerCommandHandler(Function<Configuration, Object> commandHandlerBuilder) Registers a command handler bean with thisConfigurer.<C> ConfigurerregisterComponent(Class<C> componentType, Function<Configuration, ? extends C> componentBuilder) Registers a component which should be made available to other components or modules in this Configuration.default ConfigurerregisterEventHandler(Function<Configuration, Object> eventHandlerBuilder) Registers aFunctionthat builds an Event Handler instance.registerEventUpcaster(Function<Configuration, EventUpcaster> upcasterBuilder) Registers an upcaster to be used to upcast Events to a newer versionregisterHandlerDefinition(BiFunction<Configuration, Class, HandlerDefinition> handlerDefinitionClass) Registers the definition of a Handler class.registerHandlerEnhancerDefinition(Function<Configuration, HandlerEnhancerDefinition> handlerEnhancerBuilder) Registers a builder function for aHandlerEnhancerDefinitionused during constructing of the defaultHandlerDefinition.registerMessageHandler(Function<Configuration, Object> messageHandlerBuilder) Registers a message handler bean with this configuration.registerModule(ModuleConfiguration module) Registers an Axon module with this configuration.default ConfigurerregisterQueryHandler(int phase, Function<Configuration, Object> queryHandlerBuilder) Deprecated.in favor ofregisterQueryHandler(Function), since thephaseof an annotated handler should be defined through theStartHandler/ShutdownHandlerannotation.registerQueryHandler(Function<Configuration, Object> queryHandlerBuilder) Registers a query handler bean with thisConfigurer.default Configurationstart()Builds the configuration and starts it immediately.Methods inherited from interface org.axonframework.config.LifecycleOperations
onShutdown, onShutdown, onShutdown, onStart, onStart, onStart
-
Method Details
-
registerEventUpcaster
Registers an upcaster to be used to upcast Events to a newer version- Parameters:
upcasterBuilder- The function that returns an EventUpcaster based on the configuration- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureMessageMonitor
Configurer configureMessageMonitor(@Nonnull Function<Configuration, BiFunction<Class<?>, String, MessageMonitor<Message<?>>>> messageMonitorFactoryBuilder) Configures the Message Monitor to use for the Message processing components in this configuration, unless more specific configuration based on the component's type, or type and name is available. The builder function receives the type of component as well as its name as input, and is expected to return a MessageMonitor instance to be used by that type of component.- Parameters:
messageMonitorFactoryBuilder- The MessageMonitor builder function- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureMessageMonitor
default Configurer configureMessageMonitor(@Nonnull Class<?> componentType, @Nonnull Function<Configuration, MessageMonitor<Message<?>>> messageMonitorBuilder) Configures the builder function to create the Message Monitor for the Message processing components in this configuration that match the given componentType, unless more specific configuration based on both type and name is available.A component matches componentType if componentType is assignable from the component's class. If a component matches multiple types, and the types derive from each other, the configuration from the most derived type is used. If the matching types do not derive from each other, the result is unspecified.
For example: in case a monitor is configured for
CommandBusand another monitor is configured forSimpleCommandBus), components of typeAsynchronousCommandBuswill use the monitor configured for the SimpleCommandBus.A component's name matches componentName if they are identical; i.e. they are compared case sensitively.
- Parameters:
componentType- The declared type of the componentmessageMonitorBuilder- The builder function to use- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureMessageMonitor
Configurer configureMessageMonitor(@Nonnull Class<?> componentType, @Nonnull MessageMonitorFactory messageMonitorFactory) Configures the factory to create the Message Monitor for the Message processing components in this configuration that match the given componentType, unless more specific configuration based on both type and name is available.A component matches componentType if componentType is assignable from the component's class. If a component matches multiple types, and the types derive from each other, the configuration from the most derived type is used. If the matching types do not derive from each other, the result is unspecified.
For example: in case a monitor is configured for
CommandBusand another monitor is configured forSimpleCommandBus), components of typeAsynchronousCommandBuswill use the monitor configured for the SimpleCommandBus.A component's name matches componentName if they are identical; i.e. they are compared case sensitively.
- Parameters:
componentType- The declared type of the componentmessageMonitorFactory- The factory to use- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureMessageMonitor
default Configurer configureMessageMonitor(@Nonnull Class<?> componentType, @Nonnull String componentName, @Nonnull Function<Configuration, MessageMonitor<Message<?>>> messageMonitorBuilder) Configures the builder function to create the Message Monitor for the Message processing components in this configuration that match the given class and name.A component matches componentType if componentType is assignable from the component's class. If a component matches multiple types, and the types derive from each other, the configuration from the most derived type is used. If the matching types do not derive from each other, the result is unspecified.
For example: in case a monitor is configured for
CommandBusand another monitor is configured forSimpleCommandBus), components of typeAsynchronousCommandBuswill use the monitor configured for the SimpleCommandBus.A component's name matches componentName if they are identical; i.e. they are compared case sensitively.
- Parameters:
componentType- The declared type of the componentcomponentName- The name of the componentmessageMonitorBuilder- The builder function to use- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureMessageMonitor
Configurer configureMessageMonitor(@Nonnull Class<?> componentType, @Nonnull String componentName, @Nonnull MessageMonitorFactory messageMonitorFactory) Configures the factory create the Message Monitor for those Message processing components in this configuration that match the given class and name.A component matches componentType if componentType is assignable from the component's class. If a component matches multiple types, and the types derive from each other, the configuration from the most derived type is used. If the matching types do not derive from each other, the result is unspecified.
For example: in case a monitor is configured for
CommandBusand another monitor is configured forSimpleCommandBus), components of typeAsynchronousCommandBuswill use the monitor configured for the SimpleCommandBus.A component's name matches componentName if they are identical; i.e. they are compared case sensitively.
- Parameters:
componentType- The declared type of the componentcomponentName- The name of the componentmessageMonitorFactory- The factory to use- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureCorrelationDataProviders
Configurer configureCorrelationDataProviders(@Nonnull Function<Configuration, List<CorrelationDataProvider>> correlationDataProviderBuilder) Configures the CorrelationDataProviders that Message processing components should use to attach correlation data to outgoing messages. The builder function receives the Configuration as input and is expected to return a list or CorrelationDataProviders.- Parameters:
correlationDataProviderBuilder- the builder function returning the CorrelationDataProvider list- Returns:
- the current instance of the Configurer, for chaining purposes
-
registerModule
Registers an Axon module with this configuration. The module is initialized when the configuration is created and has access to the global configuration when initialized.Typically, modules are registered for Event Handling components or Sagas.
- Parameters:
module- The module to register- Returns:
- the current instance of the Configurer, for chaining purposes
- See Also:
-
registerComponent
<C> Configurer registerComponent(@Nonnull Class<C> componentType, @Nonnull Function<Configuration, ? extends C> componentBuilder) Registers a component which should be made available to other components or modules in this Configuration. The builder function gets this configuration as input, and is expected to provide the component as output.Where possible, it is recommended to use the explicit
configure...andregister...methods.- Type Parameters:
C- The type of component- Parameters:
componentType- The declared type of the component, typically an interfacecomponentBuilder- The builder function of this component- Returns:
- the current instance of the Configurer, for chaining purposes
-
registerCommandHandler
Registers a command handler bean with thisConfigurer. The bean may be of any type. The actual command handler methods will be detected based on the annotations present on the bean's methods. Message handling functions annotated withCommandHandlerwill be taken into account.The builder function receives the
Configurationas input, and is expected to return a fully initialized instance of the command handler bean.- Parameters:
commandHandlerBuilder- the builder function of the command handler bean- Returns:
- the current instance of the
Configurer, for chaining purposes
-
registerCommandHandler
@Deprecated default Configurer registerCommandHandler(int phase, @Nonnull Function<Configuration, Object> commandHandlerBuilder) Deprecated.in favor ofregisterCommandHandler(Function), since thephaseof an annotated handler should be defined through theStartHandler/ShutdownHandlerannotation.Registers a command handler bean with thisConfigurer. The bean may be of any type. The actual command handler methods will be detected based on the annotations present on the bean's methods. Message handling functions annotated withCommandHandlerwill be taken into account.The builder function receives the
Configurationas input, and is expected to return a fully initialized instance of the command handler bean.- Parameters:
phase- defines a phase in which the command handler builder will be invoked duringConfiguration.start()andConfiguration.shutdown(). When starting the configuration handlers are ordered in ascending, when shutting down the configuration, descending order is used.commandHandlerBuilder- the builder function of the command handler bean- Returns:
- the current instance of the
Configurer, for chaining purposes
-
registerQueryHandler
Registers a query handler bean with thisConfigurer. The bean may be of any type. The actual query handler methods will be detected based on the annotations present on the bean's methods. Message handling functions annotated withQueryHandlerwill be taken into account.The builder function receives the
Configurationas input, and is expected to return a fully initialized instance of the query handler bean.- Parameters:
queryHandlerBuilder- the builder function of the query handler bean- Returns:
- the current instance of the
Configurer, for chaining purposes
-
registerQueryHandler
@Deprecated default Configurer registerQueryHandler(int phase, @Nonnull Function<Configuration, Object> queryHandlerBuilder) Deprecated.in favor ofregisterQueryHandler(Function), since thephaseof an annotated handler should be defined through theStartHandler/ShutdownHandlerannotation.Registers a query handler bean with thisConfigurer. The bean may be of any type. The actual query handler methods will be detected based on the annotations present on the bean's methods. Message handling functions annotated withQueryHandlerwill be taken into account.The builder function receives the
Configurationas input, and is expected to return a fully initialized instance of the query handler bean.- Parameters:
phase- defines a phase in which the query handler builder will be invoked duringConfiguration.start()andConfiguration.shutdown(). When starting the configuration handlers are ordered in ascending, when shutting down the configuration, descending order is used.queryHandlerBuilder- the builder function of the query handler bean- Returns:
- the current instance of the
Configurer, for chaining purposes
-
registerMessageHandler
Registers a message handler bean with this configuration. The bean may be of any type. The actual message handler methods will be detected based on the annotations present on the bean's methods. Message handling functions annotated withCommandHandler,EventHandlerandQueryHandlerwill be taken into account.The builder function receives the
Configurationas input, and is expected to return a fully initialized instance of the message handler bean.- Parameters:
messageHandlerBuilder- the builder function of the message handler bean- Returns:
- the current instance of the
Configurer, for chaining purposes
-
configureEmbeddedEventStore
Configurer configureEmbeddedEventStore(@Nonnull Function<Configuration, EventStorageEngine> storageEngineBuilder) Configures an Embedded Event Store which uses the given Event Storage Engine to store its events. The builder receives the Configuration as input and is expected to return a fully initializedEventStorageEngineinstance.- Parameters:
storageEngineBuilder- The builder function for theEventStorageEngine- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureEventStore
default Configurer configureEventStore(@Nonnull Function<Configuration, EventStore> eventStoreBuilder) Configures the given Event Store to use in this configuration. The builder receives the Configuration as input and is expected to return a fully initializedEventStoreinstance.- Parameters:
eventStoreBuilder- The builder function for theEventStore- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureEventBus
Configures the given Event Bus to use in this configuration. The builder receives the Configuration as input and is expected to return a fully initializedEventBusinstance.Note that this builder should not be used when an Event Store is configured. Since Axon 3, the Event Store will act as Event Bus implementation as well.
- Parameters:
eventBusBuilder- The builder function for theEventBus- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureCommandBus
default Configurer configureCommandBus(@Nonnull Function<Configuration, CommandBus> commandBusBuilder) Configures the given Command Bus to use in this configuration. The builder receives the Configuration as input and is expected to return a fully initializedCommandBusinstance.- Parameters:
commandBusBuilder- The builder function for theCommandBus- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureQueryBus
Configures the given Query Bus to use in this configuration. The builder receives the Configuration as input and is expected to return a fully initializedQueryBusinstance.- Parameters:
queryBusBuilder- The builder function for theQueryBus- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureQueryUpdateEmitter
default Configurer configureQueryUpdateEmitter(@Nonnull Function<Configuration, QueryUpdateEmitter> queryUpdateEmitterBuilder) Configures the given Query Update Emitter to use in this configuration. The builder receives the Configuration as input and is expected to return a fully initializedQueryUpdateEmitterinstance.- Parameters:
queryUpdateEmitterBuilder- The builder function for theQueryUpdateEmitter- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureSerializer
default Configurer configureSerializer(@Nonnull Function<Configuration, Serializer> serializerBuilder) Configures the given Serializer to use in this configuration. The builder receives the Configuration as input and is expected to return a fully initializedSerializerinstance.- Parameters:
serializerBuilder- The builder function for theSerializer- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureEventSerializer
Configurer configureEventSerializer(@Nonnull Function<Configuration, Serializer> eventSerializerBuilder) Configures the given event Serializer to use in this configuration. The builder receives the Configuration as input and is expected to return a fully initializedSerializerinstance. This Serializer is specifically used to serialize EventMessage payload and metadata.- Parameters:
eventSerializerBuilder- The builder function for theSerializer.- Returns:
- The current instance of the Configurer, for chaining purposes.
-
configureMessageSerializer
Configurer configureMessageSerializer(@Nonnull Function<Configuration, Serializer> messageSerializerBuilder) Configures the given event Serializer to use in this configuration. The builder receives the Configuration as input and is expected to return a fully initializedSerializerinstance. This Serializer is specifically used to serialize Message payload and Metadata.- Parameters:
messageSerializerBuilder- The builder function for theSerializer.- Returns:
- The current instance of the Configurer, for chaining purposes.
-
configureTransactionManager
default Configurer configureTransactionManager(@Nonnull Function<Configuration, TransactionManager> transactionManagerBuilder) Configures the given Transaction Manager to use in this configuration. The builder receives the Configuration as input and is expected to return a fully initializedTransactionManagerinstance.- Parameters:
transactionManagerBuilder- The builder function for theTransactionManager- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureResourceInjector
default Configurer configureResourceInjector(@Nonnull Function<Configuration, ResourceInjector> resourceInjectorBuilder) Configures the given Resource Injector to use for Sagas in this configuration. The builder receives the Configuration as input and is expected to return a fully initializedResourceInjectorinstance.- Parameters:
resourceInjectorBuilder- The builder function for theResourceInjector- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureTags
Configures the given Tags Configuration to use in this configuration. The builder receives the Configuration as input and is expected to return a fully initializedTagsConfigurationinstance.- Parameters:
tagsBuilder- The builder function for theTagsConfiguration- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureAggregate
Configures an Aggregate in this configuration based on the givenaggregateConfiguration. This method allows for more fine-grained configuration compared to theconfigureAggregate(Class)method.- Type Parameters:
A- The type of aggregate the configuration is for- Parameters:
aggregateConfiguration- The instance describing the configuration of an Aggregate- Returns:
- the current instance of the Configurer, for chaining purposes
- See Also:
-
configureAggregate
Configures an Aggregate using default settings. This means the aggregate is expected to be Event Sourced if an Event Store present in the configuration. Otherwise, an explicit repository must be configured and theconfigureAggregate(AggregateConfiguration)must be used to register the aggregate.- Type Parameters:
A- The type of aggregate- Parameters:
aggregate- The aggregate type to register with the Configuration- Returns:
- the current instance of the Configurer, for chaining purposes
-
registerHandlerDefinition
Configurer registerHandlerDefinition(@Nonnull BiFunction<Configuration, Class, HandlerDefinition> handlerDefinitionClass) Registers the definition of a Handler class. Defaults to annotation based recognition of handler methods.- Parameters:
handlerDefinitionClass- A function providing the definition based on the current Configuration as well as the class being inspected.- Returns:
- the current instance of the Configurer, for chaining purposes
-
registerHandlerEnhancerDefinition
Configurer registerHandlerEnhancerDefinition(Function<Configuration, HandlerEnhancerDefinition> handlerEnhancerBuilder) Registers a builder function for aHandlerEnhancerDefinitionused during constructing of the defaultHandlerDefinition.Any number of handler enhancer builder functions can be registered through this method. Note that any
HandlerEnhancerDefinitionsregistered through this method are ignored for handlers matching the type used in theregisterHandlerDefinition(BiFunction)method's lambda.- Parameters:
handlerEnhancerBuilder- A lambda constructing aHandlerEnhancerDefinitionbased on theConfiguration.- Returns:
- The current instance of the
Configurer, for chaining purposes.
-
configureSnapshotter
default Configurer configureSnapshotter(@Nonnull Function<Configuration, Snapshotter> snapshotterBuilder) Registers aSnapshotterinstance with thisConfigurer. Defaults to aAggregateSnapshotterimplementation.- Parameters:
snapshotterBuilder- the builder function for theSnapshotter- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureDeadlineManager
default Configurer configureDeadlineManager(@Nonnull Function<Configuration, DeadlineManager> deadlineManagerBuilder) Registers aDeadlineManagerinstance with thisConfigurer. Defaults to aSimpleDeadlineManagerimplementation.- Parameters:
deadlineManagerBuilder- a builder function for theDeadlineManager- Returns:
- the current instance of the Configurer, for chaining purposes
-
configureSpanFactory
Registers aSpanFactoryinstance with thisConfigurer. Defaults to aNoOpSpanFactoryimplementation.- Parameters:
spanFactory- a builder function for theSpanFactory- Returns:
- the current instance of the Configurer, for chaining purposes
-
eventProcessing
Retrieve theEventProcessingConfigurerregistered as a module with this Configurer. If there aren't any, it will create anEventProcessingModuleand register it as a module. If there are multiple, anAxonConfigurationExceptionis thrown.- Returns:
- an instance of Event Processing Configurer
- Throws:
AxonConfigurationException- thrown if there are multipleEventProcessingConfigurers
-
eventProcessing
default Configurer eventProcessing(@Nonnull Consumer<EventProcessingConfigurer> eventProcessingConfigurer) throws AxonConfigurationException Locates theEventProcessingConfigurerregistered as a module with this Configurer and provides it to the given consumer for configuration. If there aren't any pre-registered instances ofEventProcessingConfigurer, it will create anEventProcessingModuleand register it as a module. If there are multiple, anAxonConfigurationExceptionis thrown. This method is identical to usingeventProcessing(), except that this variant allows for easier fluent interfacing.- Parameters:
eventProcessingConfigurer- a consumer to configure the- Returns:
- an instance of Event Processing Configurer
- Throws:
AxonConfigurationException- thrown if there are multipleEventProcessingConfigurers
-
registerEventHandler
default Configurer registerEventHandler(@Nonnull Function<Configuration, Object> eventHandlerBuilder) Registers aFunctionthat builds an Event Handler instance.- Parameters:
eventHandlerBuilder- aFunctionthat builds an Event Handler instance.- Returns:
- the current instance of the Configurer, for chaining purposes.
-
configureLifecyclePhaseTimeout
Configures the timeout of each lifecycle phase. The Configurer invokes lifecycle phases during start-up and shutdown of an application.Note that if a lifecycle phase exceeds the configured
timeoutandtimeUnitcombination, the Configurer will proceed with the following phase. A phase-skip is marked with a warn logging message, as the chances are high this causes undesired side effects.The default lifecycle phase timeout is five seconds.
- Parameters:
timeout- the amount of time to wait for lifecycle phase completiontimeUnit- the unit in which thetimeoutis expressed- Returns:
- the current instance of the Configurer, for chaining purposes
- See Also:
-
onInitialize
Register an initialization handler which should be invoked prior to starting thisConfigurer.- Parameters:
initHandler- aConsumerof the configuration, to be ran upon initialization of theConfiguration
-
buildConfiguration
Configuration buildConfiguration()Returns the completely initialized Configuration built using this configurer. It is not recommended to change any configuration on this Configurer once this method is called.- Returns:
- the fully initialized Configuration
-
start
Builds the configuration and starts it immediately. It is not recommended to change any configuration on this Configurer once this method is called.- Returns:
- The started configuration
-
registerCommandHandler(Function), since thephaseof an annotated handler should be defined through theStartHandler/ShutdownHandlerannotation.