public class CommandLineExecutorComponent extends DefaultComponent implements CommandLineExecutorService
CommandLineExecutorService
interface. Also
handles the Extension Point logic.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_EXECUTOR |
static String |
DEFAULT_TESTER |
static String |
EP_CMD |
static String |
EP_CMDTESTER |
static String |
EP_ENV |
VALID_PARAMETER_PATTERN, VALID_PARAMETER_PATTERN_WIN
Constructor and Description |
---|
CommandLineExecutorComponent() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
void |
checkParameter(String parameter)
Checks if the given
parameter is valid to be used in a command. |
void |
deactivate(ComponentContext context)
Deactivates the component.
|
ExecResult |
execCommand(String commandName,
CmdParameters params) |
List<String> |
getAvailableCommands() |
CommandAvailability |
getCommandAvailability(String commandName) |
static CommandLineDescriptor |
getCommandDescriptor(String commandName) |
List<String> |
getRegistredCommands() |
boolean |
isValidParameter(String parameter)
Returns true if the given
parameter is valid to be used in a
command. |
static boolean |
isWindows() |
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
applicationStarted, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, unregisterExtension
public static final String EP_ENV
public static final String EP_CMD
public static final String EP_CMDTESTER
public static final String DEFAULT_TESTER
public static final String DEFAULT_EXECUTOR
public void activate(ComponentContext context) throws Exception
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextException
- if an error occurs during activationpublic void deactivate(ComponentContext context) throws Exception
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextException
- if an error occurs during activationpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
registerContribution
in class DefaultComponent
Exception
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
unregisterContribution
in class DefaultComponent
Exception
public ExecResult execCommand(String commandName, CmdParameters params) throws CommandNotAvailable
execCommand
in interface CommandLineExecutorService
CommandNotAvailable
public CommandAvailability getCommandAvailability(String commandName)
getCommandAvailability
in interface CommandLineExecutorService
public List<String> getRegistredCommands()
getRegistredCommands
in interface CommandLineExecutorService
public List<String> getAvailableCommands()
getAvailableCommands
in interface CommandLineExecutorService
public static boolean isWindows()
public boolean isValidParameter(String parameter)
CommandLineExecutorService
parameter
is valid to be used in a
command.isValidParameter
in interface CommandLineExecutorService
public void checkParameter(String parameter)
CommandLineExecutorService
parameter
is valid to be used in a command.
If not, throws an IllegalArgumentException
.
checkParameter
in interface CommandLineExecutorService
public static CommandLineDescriptor getCommandDescriptor(String commandName)
Copyright © 2013 Nuxeo SA. All Rights Reserved.