org.nuxeo.ecm.shell
Class CommandLineService
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.shell.CommandLineService
- All Implemented Interfaces:
- java.util.EventListener, Adaptable, Component, Extensible, org.osgi.framework.FrameworkListener
public class CommandLineService
- extends DefaultComponent
- implements org.osgi.framework.FrameworkListener
- Author:
- Bogdan Stefanescu
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAME
public static final ComponentName NAME
CommandLineService
public CommandLineService()
activate
public void activate(ComponentContext context)
throws java.lang.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:
java.lang.Exception
- if an error occurs during activation
reload
public void reload()
- Reloads script commands
deactivate
public void deactivate(ComponentContext context)
throws java.lang.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:
java.lang.Exception
- if an error occurs during activation
registerContribution
public void registerContribution(java.lang.Object contribution,
java.lang.String extensionPoint,
ComponentInstance contributor)
- Overrides:
registerContribution
in class DefaultComponent
unregisterContribution
public void unregisterContribution(java.lang.Object contribution,
java.lang.String extensionPoint,
ComponentInstance contributor)
- Overrides:
unregisterContribution
in class DefaultComponent
getCommand
public CommandDescriptor getCommand(java.lang.String name)
addCommand
public void addCommand(CommandDescriptor cmd)
removeCommand
public void removeCommand(java.lang.String name)
getCommands
public CommandDescriptor[] getCommands()
getCommandNames
public java.lang.String[] getCommandNames()
getSortedCommands
public CommandDescriptor[] getSortedCommands()
getMatchingCommands
public CommandDescriptor[] getMatchingCommands(java.lang.String prefix)
getCommandOption
public CommandOption getCommandOption(java.lang.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(java.lang.String[] args,
boolean validate)
throws java.text.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:
java.text.ParseException
runCommand
public void runCommand(CommandDescriptor cd,
CommandLine cmdLine)
throws java.lang.Exception
- Throws:
java.lang.Exception
frameworkEvent
public void frameworkEvent(org.osgi.framework.FrameworkEvent event)
- Specified by:
frameworkEvent
in interface org.osgi.framework.FrameworkListener
Copyright © 2010 Nuxeo SAS. All Rights Reserved.