Interface CommandHandler
-
- All Known Implementing Classes:
AnnotatedCommandHandler
public interface CommandHandlerCommon interface for all Command message handlers
A command handler can choose support to 1 or more command types- See Also:
AnnotatedCommandHandler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanHandle(Class<?> commandType)This method is called by theLocalCommandBusto check if this concreteCommandHandlersupports a given command typeObjecthandle(Object command)This method is called by theLocalCommandBusafter it has determined that only thisCommandHandlerinstance is capable of handling the command (based on the commands type)
-
-
-
Method Detail
-
canHandle
boolean canHandle(Class<?> commandType)
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
Object handle(Object command)
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)
-
-