com.sun.enterprise.v3.admin
Class CommandRunnerImpl

java.lang.Object
  extended by com.sun.enterprise.v3.admin.CommandRunnerImpl
All Implemented Interfaces:
CommandRunner

@Service
public class CommandRunnerImpl
extends Object
implements CommandRunner

Encapsulates the logic needed to execute a server-side command (for example, a descendant of AdminCommand) including injection of argument values into the command.

Author:
dochez, tjquinn, Bill Shannon

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.glassfish.api.admin.CommandRunner
CommandRunner.CommandInvocation
 
Constructor Summary
CommandRunnerImpl()
           
 
Method Summary
 ActionReport getActionReport(String name)
          Returns an initialized ActionReport instance for the passed type or null if it cannot be found.
 AdminCommand getCommand(String commandName, ActionReport report, Logger logger)
          Obtain and return the command implementation defined by the passed commandName.
 CommandRunner.CommandInvocation getCommandInvocation(String name, ActionReport report)
          Obtain a new command invocation object.
 void getHelp(AdminCommand command, ActionReport report)
           
static BufferedReader getManPage(String commandName, CommandModel model)
          Return an InputStream for the man page for the named command.
 CommandModel getModel(String commandName, Logger logger)
          Retuns the command model for a command name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandRunnerImpl

public CommandRunnerImpl()
Method Detail

getActionReport

public ActionReport getActionReport(String name)
Returns an initialized ActionReport instance for the passed type or null if it cannot be found.

Specified by:
getActionReport in interface CommandRunner
Parameters:
name - actiopn report type name
Returns:
uninitialized action report or null

getModel

public CommandModel getModel(String commandName,
                             Logger logger)
Retuns the command model for a command name.

Specified by:
getModel in interface CommandRunner
Parameters:
commandName - command name
logger - logger to log any error messages
Returns:
model for this command (list of parameters,etc...), or null if command is not found

getCommand

public AdminCommand getCommand(String commandName,
                               ActionReport report,
                               Logger logger)
Obtain and return the command implementation defined by the passed commandName.

Specified by:
getCommand in interface CommandRunner
Parameters:
commandName - command name as typed by users
report - report used to communicate command status back to the user
logger - logger to log
Returns:
command registered under commandName or null if not found

getCommandInvocation

public CommandRunner.CommandInvocation getCommandInvocation(String name,
                                                            ActionReport report)
Obtain a new command invocation object. Command invocations can be configured and used to trigger a command execution.

Specified by:
getCommandInvocation in interface CommandRunner
Parameters:
name - name of the requested command to invoke
report - where to place the status of the command execution
Returns:
a new command invocation for that command name

getHelp

public void getHelp(AdminCommand command,
                    ActionReport report)

getManPage

public static BufferedReader getManPage(String commandName,
                                        CommandModel model)
Return an InputStream for the man page for the named command.



Copyright © 2012. All Rights Reserved.