public class DefaultCommandHandlerRegistry extends Object implements CommandHandlerRegistry
DefaultCommandHandlerRegistry class is the default implementation of the
CommandHandlerRegistry interface.| Constructor and Description |
|---|
DefaultCommandHandlerRegistry() |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(CommandHandler<? extends Command<? extends CommandResponse>,? extends CommandResponse> commandHandler)
Adds
commandHandler to the commandHandler registry. |
void |
addHandlers(List<? extends CommandHandler<? extends Command<? extends CommandResponse>,? extends CommandResponse>> commandHandlers)
Adds
commandHandlers to the handler registry. |
CommandHandler<? extends Command<? extends CommandResponse>,? extends CommandResponse> |
getHandlerFor(String commandType)
Retrieves concrete
CommandHandler for the type of the command. |
List<CommandHandler<? extends Command<? extends CommandResponse>,? extends CommandResponse>> |
getHandlers()
Retrieve all handlers successfully registered in the command handler registry.
|
void |
removeHandler(String commandType)
Removes command handler which handles
commandtype type of Command
from the handler registry. |
public void addHandler(CommandHandler<? extends Command<? extends CommandResponse>,? extends CommandResponse> commandHandler)
CommandHandlerRegistrycommandHandler to the commandHandler registry.addHandler in interface CommandHandlerRegistrycommandHandler - Handler to add to the commandHandler registry.public void addHandlers(List<? extends CommandHandler<? extends Command<? extends CommandResponse>,? extends CommandResponse>> commandHandlers)
CommandHandlerRegistrycommandHandlers to the handler registry.addHandlers in interface CommandHandlerRegistrycommandHandlers - List of commandHandlers to add to the handler registry.public CommandHandler<? extends Command<? extends CommandResponse>,? extends CommandResponse> getHandlerFor(String commandType)
CommandHandlerRegistryCommandHandler for the type of the command. If not found, returns
null.getHandlerFor in interface CommandHandlerRegistrycommandType - Command type identifier that is unique system-wide.CommandHandler based
on the commandType. If no handler is found for the command type,
returns null.public void removeHandler(String commandType)
CommandHandlerRegistrycommandtype type of Command
from the handler registry.removeHandler in interface CommandHandlerRegistrycommandType - Command type identifier that is unique system-wide.public List<CommandHandler<? extends Command<? extends CommandResponse>,? extends CommandResponse>> getHandlers()
CommandHandlerRegistrygetHandlers in interface CommandHandlerRegistryCopyright © 2018. All rights reserved.