Class CommandRegistry
java.lang.Object
org.springframework.shell.core.command.CommandRegistry
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.SmartInitializingSingleton,org.springframework.context.ApplicationContextAware
public class CommandRegistry
extends Object
implements org.springframework.beans.factory.SmartInitializingSingleton, org.springframework.context.ApplicationContextAware
Class representing a registry of
Commands. If defined as a Spring bean, it will
be automatically populated by Spring with all available commands. Commands can also be
registered and unregistered at runtime.
Commands are uniquely identified by their name.
- Author:
- Janne Valkealahti, Piotr Olaszewski, Mahmoud Ben Hassine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoid@Nullable CommandgetCommandByAlias(String name) @Nullable CommandgetCommandByName(String name) getCommandsByPrefix(String prefix) voidregisterCommand(Command command) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidunregisterCommand(Command command)
-
Constructor Details
-
CommandRegistry
public CommandRegistry() -
CommandRegistry
-
-
Method Details
-
getCommands
-
getCommandByName
-
getCommandByAlias
-
getCommandsByPrefix
-
registerCommand
-
unregisterCommand
-
clearCommands
public void clearCommands() -
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- Specified by:
afterSingletonsInstantiatedin interfaceorg.springframework.beans.factory.SmartInitializingSingleton
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-