Class CommandLineExecutorComponent
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent
-
- All Implemented Interfaces:
CommandLineExecutorService,Adaptable,Component,Extensible,TimestampedService
public class CommandLineExecutorComponent extends DefaultComponent implements CommandLineExecutorService
POJO implementation of theCommandLineExecutorServiceinterface. Also handles the Extension Point logic.- Author:
- tiry
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,CommandLineDescriptor>commandDescriptorsstatic StringDEFAULT_EXECUTORstatic StringDEFAULT_TESTERprotected EnvironmentDescriptorenvprotected Map<String,EnvironmentDescriptor>envDescriptorsstatic StringEP_CMDstatic StringEP_CMDTESTERstatic StringEP_ENVprotected Map<String,Executor>executorsprotected Map<String,CommandTester>testersprotected booleanuseTimeout-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description CommandLineExecutorComponent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidactivate(ComponentContext context)Activates the component.voiddeactivate(ComponentContext context)Deactivates the component.ExecResultexecCommand(String commandName, CmdParameters params)List<String>getAvailableCommands()CommandAvailabilitygetCommandAvailability(String commandName)static CommandLineDescriptorgetCommandDescriptor(String commandName)Deprecated.since 11.4, use instance methodgetCommandLineDescriptor(java.lang.String)insteadCommandLineDescriptorgetCommandLineDescriptor(String commandName)CmdParametersgetDefaultCmdParameters()List<String>getRegistredCommands()voidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)voidstart(ComponentContext context)Start the component.voidunregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, stop, unregister, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
EP_ENV
public static final String EP_ENV
- See Also:
- Constant Field Values
-
EP_CMD
public static final String EP_CMD
- See Also:
- Constant Field Values
-
EP_CMDTESTER
public static final String EP_CMDTESTER
- See Also:
- Constant Field Values
-
DEFAULT_TESTER
public static final String DEFAULT_TESTER
- See Also:
- Constant Field Values
-
DEFAULT_EXECUTOR
public static final String DEFAULT_EXECUTOR
- See Also:
- Constant Field Values
-
commandDescriptors
protected Map<String,CommandLineDescriptor> commandDescriptors
-
env
protected EnvironmentDescriptor env
-
envDescriptors
protected Map<String,EnvironmentDescriptor> envDescriptors
-
testers
protected Map<String,CommandTester> testers
-
useTimeout
protected boolean useTimeout
-
-
Method Detail
-
activate
public void activate(ComponentContext context)
Description copied from interface:ComponentActivates the component.This method is called by the runtime when a component is activated.
- Specified by:
activatein interfaceComponent- Overrides:
activatein classDefaultComponent- Parameters:
context- the runtime context
-
start
public void start(ComponentContext context)
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
deactivate
public void deactivate(ComponentContext context)
Description copied from interface:ComponentDeactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivatein interfaceComponent- Overrides:
deactivatein classDefaultComponent- Parameters:
context- the runtime context
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
registerContributionin classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContributionin classDefaultComponent
-
execCommand
public ExecResult execCommand(String commandName, CmdParameters params) throws CommandNotAvailable
- Specified by:
execCommandin interfaceCommandLineExecutorService- Throws:
CommandNotAvailable
-
getCommandAvailability
public CommandAvailability getCommandAvailability(String commandName)
- Specified by:
getCommandAvailabilityin interfaceCommandLineExecutorService
-
getRegistredCommands
public List<String> getRegistredCommands()
- Specified by:
getRegistredCommandsin interfaceCommandLineExecutorService
-
getAvailableCommands
public List<String> getAvailableCommands()
- Specified by:
getAvailableCommandsin interfaceCommandLineExecutorService
-
getCommandLineDescriptor
public CommandLineDescriptor getCommandLineDescriptor(String commandName)
- Specified by:
getCommandLineDescriptorin interfaceCommandLineExecutorService
-
getCommandDescriptor
@Deprecated public static CommandLineDescriptor getCommandDescriptor(String commandName)
Deprecated.since 11.4, use instance methodgetCommandLineDescriptor(java.lang.String)instead
-
getDefaultCmdParameters
public CmdParameters getDefaultCmdParameters()
- Specified by:
getDefaultCmdParametersin interfaceCommandLineExecutorService- Returns:
- a new
CmdParameterspre-filled with commonly used parameters such as the tmp dir.
-
-