org.nuxeo.ecm.shell
Class CommandLineService
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.shell.CommandLineService
- All Implemented Interfaces:
- Adaptable, Component, Extensible
public class CommandLineService
- extends DefaultComponent
- Author:
- Bogdan Stefanescu
NAME
public static final ComponentName NAME
CommandLineService
public CommandLineService()
activate
public void activate(ComponentContext context)
throws Exception
- Description copied from interface:
Component
- Activates the component.
This method is called by the runtime when a component is activated.
- Specified by:
activate
in interface Component
- Overrides:
activate
in class DefaultComponent
- Parameters:
context
- the runtime context
- Throws:
Exception
- if an error occurs during activation
reload
public void reload()
- Reloads script commands
deactivate
public void deactivate(ComponentContext context)
throws Exception
- Description copied from interface:
Component
- Deactivates the component.
This method is called by the runtime when a component is deactivated.
- Specified by:
deactivate
in interface Component
- Overrides:
deactivate
in class DefaultComponent
- Parameters:
context
- the runtime context
- Throws:
Exception
- if an error occurs during activation
registerContribution
public void registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor)
- Overrides:
registerContribution
in class DefaultComponent
unregisterContribution
public void unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor)
- Overrides:
unregisterContribution
in class DefaultComponent
getCommand
public CommandDescriptor getCommand(String name)
addCommand
public void addCommand(CommandDescriptor cmd)
removeCommand
public void removeCommand(String name)
getCommands
public CommandDescriptor[] getCommands()
getCommandNames
public String[] getCommandNames()
getSortedCommands
public CommandDescriptor[] getSortedCommands()
getMatchingCommands
public CommandDescriptor[] getMatchingCommands(String prefix)
getCommandOption
public CommandOption getCommandOption(String name)
getCommandOptions
public CommandOption[] getCommandOptions()
addCommandOption
public void addCommandOption(CommandOption arg)
removeCommandOption
public void removeCommandOption(CommandOption arg)
getCommandContext
public CommandContext getCommandContext()
parse
public CommandLine parse(String[] args,
boolean validate)
throws ParseException
- Parameters:
args
- the arguments as passed on the command line by a user, the
first argument needs to be a command, if none is found the
"interactive" command is assumed.validate
- specifies whether errors in parsing or in the passed
arguments and options should throw ParseException
- Returns:
- a CommandLine initialized object
- Throws:
ParseException
runCommand
public void runCommand(CommandDescriptor cd,
CommandLine cmdLine)
throws Exception
- Throws:
Exception
applicationStarted
public void applicationStarted(ComponentContext context)
throws Exception
- Description copied from interface:
Component
- Notify the component that Nuxeo Framework finished starting all Nuxeo
bundles.
- Specified by:
applicationStarted
in interface Component
- Overrides:
applicationStarted
in class DefaultComponent
- Throws:
Exception
Copyright © 2011 Nuxeo SAS. All Rights Reserved.