org.glassfish.api.admin
Interface CommandRunner


@Contract
public interface CommandRunner

CommandRunner is a service that allows you to run administrative commands.

Author:
Jerome Dochez

Nested Class Summary
static interface CommandRunner.CommandInvocation
          CommandInvocation defines a command excecution context like the requested name of the command to execute, the parameters of the command, etc...
 
Method Summary
 ActionReport getActionReport(java.lang.String name)
          Returns an initialized ActionReport instance for the passed type or null if it cannot be found.
 AdminCommand getCommand(java.lang.String commandName, ActionReport report, java.util.logging.Logger logger)
          Obtain and return the command implementation defined by the passed commandName
 CommandRunner.CommandInvocation getCommandInvocation(java.lang.String name, ActionReport report)
          Obtain a new command invocation object.
 CommandModel getModel(java.lang.String name, java.util.logging.Logger logger)
          Retuns the command model for a command name
 

Method Detail

getActionReport

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

Parameters:
name - actiopn report type name
Returns:
uninitialized action report or null

getModel

CommandModel getModel(java.lang.String name,
                      java.util.logging.Logger logger)
Retuns the command model for a command name

Parameters:
name - command name
logger - logger to log any error messages
Returns:
model for this command (list of parameters,etc...), null if command is not found

getCommand

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

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

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

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.


Copyright © 2012 GlassFish Community. All Rights Reserved.