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.SmartLifecycle
public void stop(Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle
public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public int getPhase()
getPhase
in interface org.springframework.context.Phased
Copyright © 2010–2017. All rights reserved.