All Classes
-
All Classes Interface Summary Class Summary Exception Summary Annotation Types Summary Class Description AnnotatedCommandHandler Extending this class will allow you to colocate multiple related Command handling methods inside the same class and use it together with theLocalCommandBus
Each method must accept a single Command argument, may return a value or return void and be annotated with theEventHandlerannotation.
The method argument type is matched against the concrete command type usingClass.isAssignableFrom(Class).
The method accessibility can be any combination of private, protected, public, etc.
Example:AnnotatedEventHandler<EVENT_TYPE> Extending this class will allow you to colocate multiple related Event handling methods inside the same class and use it together with theLocalEventBus
Each method must accept a single Event argument, return void and be annotated with theEventHandlerannotation.
The method argument type is matched against the concrete event type usingClass.isAssignableFrom(Class).
The method accessibility can be any combination of private, protected, public, etc.
Example:CommandHandler Common interface for all Command message handlers
A command handler can choose support to 1 or more command typesEventHandler Method annotation that can be applied to any single argument method insideAnnotatedEventHandlerafter which the method will be a candidate for event message handling.
Each method must accept a single Event argument, return void and be annotated with theEventHandlerannotation.
The method argument type is matched against the concrete event type usingClass.isAssignableFrom(Class).
The method accessibility can be any combination of private, protected, public, etc.Handler Method annotation that can be applied to any single argument method insideAnnotatedCommandHandlerafter which the method will be a candidate for command message handling.
The single method argument type is matched against the concrete command type usingClass.isAssignableFrom(Class).
The method accessibility can be any combination of private, protected, public, etc.
The method may return a value or void.LocalCommandBus TheLocalCommandBusprovides an indirection between a command and theCommandHandlerthat's capable of handling the command.
Commands can be sent synchronously usingLocalCommandBus.send(Object)or asynchronously usingLocalCommandBus.sendAsync(Object)that returns aMono.
The handling of a command usually doesn't return any value (according to the principles of CQRS), however theLocalCommandBusAPI allows aCommandHandlerto return a value if needed (e.g.LocalEventBus<EVENT_TYPE> Simple event bus that supports both synchronous and asynchronous subscribers that are registered and listening for events published within the local the JVM
You can have multiple instances of the LocalEventBus deployed with the local JVM, but usually one event bus is sufficient.
Example:MultipleCommandHandlersFoundException NoCommandHandlerFoundException OnErrorHandler<EVENT_TYPE> Error Handler interface for theLocalEventBusPublishException SendCommandException