Interface CommandHandler
- All Known Implementing Classes:
AnnotatedCommandHandler
public interface CommandHandler
Common interface for all Command message handlers
A command handler can choose support to 1 or more command types
A command handler can choose support to 1 or more command types
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanThis method is called by theLocalCommandBusto check if this concreteCommandHandlersupports a given command typeThis method is called by theLocalCommandBusafter it has determined that only thisCommandHandlerinstance is capable of handling the command (based on the commands type)
-
Method Details
-
canHandle
This method is called by theLocalCommandBusto check if this concreteCommandHandlersupports a given command type- Parameters:
commandType- the type of command being processed by theLocalCommandBus- Returns:
- true if this command handler can handle a command of the given type - otherwise it must return false
-
handle
This method is called by theLocalCommandBusafter it has determined that only thisCommandHandlerinstance is capable of handling the command (based on the commands type)- Parameters:
command- the command- Returns:
- the result of handling the command (if any)
-