@Singleton public class CommandsManager extends ObservedManager
Modifier and Type | Field and Description |
---|---|
static String |
COMMAND_DELIM |
static String |
DEFAULT_CATALOG |
log, registeredUUIDs
Constructor and Description |
---|
CommandsManager(Node2BeanProcessor nodeToBean) |
Modifier and Type | Method and Description |
---|---|
boolean |
executeCommand(Command command,
Map<String,Object> params)
Executes the given command.
|
boolean |
executeCommand(Command command,
Map<String,Object> params,
Context context)
Executes the given command with given context.
|
boolean |
executeCommand(String commandName,
Map<String,Object> params)
Executes the given command by first looking in the default catalog.
|
boolean |
executeCommand(String catalogName,
String commandName,
Map<String,Object> params)
Executes the given command at the given catalog with the given
parameters.
|
Command |
getCommand(String commandName)
Use a delimiter to separate the catalog and command name.
|
Command |
getCommand(String catalogName,
String commandName)
Get the command.
|
static CommandsManager |
getInstance()
Deprecated.
since 4.5, use IoC !
|
protected void |
onClear()
Clear all catalogs.
|
protected void |
onRegister(Content node)
Register observation for command catalogs.
|
protected void |
registerCatalog(Content node) |
clear, getNodeByIdentifierOrPath, register, reload, reload
public static final String DEFAULT_CATALOG
public static final String COMMAND_DELIM
@Inject public CommandsManager(Node2BeanProcessor nodeToBean)
protected void onRegister(Content node)
onRegister
in class ObservedManager
protected void registerCatalog(Content node)
protected void onClear()
onClear
in class ObservedManager
public Command getCommand(String catalogName, String commandName)
catalogName
- the catalog containing the commandcommandName
- the name of the commandpublic Command getCommand(String commandName)
@Deprecated public static CommandsManager getInstance()
public boolean executeCommand(String catalogName, String commandName, Map<String,Object> params) throws Exception
Exception
- if an error occurs during command execution or if the command
could not be found in any catalog.public boolean executeCommand(String commandName, Map<String,Object> params) throws Exception
Exception
executeCommand(String, String, Map)
public boolean executeCommand(Command command, Map<String,Object> params) throws Exception
Exception
executeCommand(String, Map)
Copyright © 2003–2016 Magnolia International Ltd.. All rights reserved.