org.axonframework.contextsupport.spring
Annotation Type AnnotationDriven


@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
@Import(value=AnnotationDrivenConfiguration.class)
public @interface AnnotationDriven

Annotation for @Configuration that will automatically subscribe @CommandHandler and @EventHandler annotated beans with the CommandBus and EventBus, respectively.

If a context contains multiple EventBus or CommandBus implementations, you must indicate the isntance to use as a property on this annotation.

Since:
2.3
Author:
Allard Buijze

Optional Element Summary
 String commandBus
          The bean name of the Command Bus to register @CommandHandler annotated beans with.
 String eventBus
          The bean name of the Event Bus to register @EventHandler annotated beans with.
 int phase
          The phase in the application context lifecycle in which to subscribe (and possibly unsubscribe) the handlers with the CommandBus and EventBus.
 boolean unsubscribeOnShutdown
          Whether to unsubscribe beans on shutdown.
 

eventBus

public abstract String eventBus
The bean name of the Event Bus to register @EventHandler annotated beans with.

Default:
""

commandBus

public abstract String commandBus
The bean name of the Command Bus to register @CommandHandler annotated beans with.

Default:
""

unsubscribeOnShutdown

public abstract boolean unsubscribeOnShutdown
Whether to unsubscribe beans on shutdown. Default to false. Setting this to true will explicitly unsubscribe beans from the Event- and CommandBus when shutting down the application context.

Default:
false

phase

public abstract int phase
The phase in the application context lifecycle in which to subscribe (and possibly unsubscribe) the handlers with the CommandBus and EventBus.

Default:
0


Copyright © 2010-2016. All Rights Reserved.