public class EventHandlerRegistrar extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.context.SmartLifecycle
To customize this behavior, define a Bean of type EventHandlingConfiguration in the application context:
@Bean
public EventHandlingConfiguration eventHandlerConfiguration() {
return new EventHandlingConfiguration();
}
| Constructor and Description |
|---|
EventHandlerRegistrar(AxonConfiguration axonConfiguration,
EventHandlingConfiguration eventHandlingConfiguration)
Initialize the registrar to register beans discovered with the given
eventHandlingConfiguration. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
void |
setEventHandlers(List<Object> beans)
Registers the given
beans as event handlers with the Event Handler Configuration. |
void |
start() |
void |
stop() |
void |
stop(Runnable callback) |
public EventHandlerRegistrar(AxonConfiguration axonConfiguration, EventHandlingConfiguration eventHandlingConfiguration)
eventHandlingConfiguration.
The registrar will also initialize the EventHandlerConfiguration using the given axonConfiguration
and start it.axonConfiguration - The main Axon Configuration instanceeventHandlingConfiguration - The main Axon Configurationpublic void setEventHandlers(List<Object> beans)
beans as event handlers with the Event Handler Configuration. The beans are sorted
(see AnnotationAwareOrderComparator) before registering them to the configuration.beans - the beans to registerpublic boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic void stop(Runnable callback)
stop in interface org.springframework.context.SmartLifecyclepublic void start()
start in interface org.springframework.context.Lifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic int getPhase()
getPhase in interface org.springframework.context.PhasedCopyright © 2010–2017. All rights reserved.