public class EventHandlerRegistrar extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.context.SmartLifecycle
To customize this behavior, define a Bean of type EventProcessingModule
in the application context:
@Bean public EventProcessingModule eventProcessing() { return new EventProcessingModule(); }
Constructor and Description |
---|
EventHandlerRegistrar(AxonConfiguration axonConfiguration,
ModuleConfiguration eventProcessingConfiguration,
EventProcessingConfigurer eventProcessingConfigurer)
Initialize the registrar to register beans discovered with the given
eventProcessing . |
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, ModuleConfiguration eventProcessingConfiguration, EventProcessingConfigurer eventProcessingConfigurer)
eventProcessing
.
The registrar will also initialize the EventHandlerConfiguration using the given axonConfiguration
and start it.axonConfiguration
- The main Axon Configuration instanceeventProcessingConfigurer
- 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
getPhase
in interface org.springframework.context.SmartLifecycle
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Copyright © 2010–2018. All rights reserved.