Class RunCommand

java.lang.Object
org.cyclopsgroup.jmxterm.Command
org.cyclopsgroup.jmxterm.cmd.RunCommand
All Implemented Interfaces:
org.cyclopsgroup.jcli.AutoCompletable

@Cli(name="run", description="Invoke an MBean operation", note="Syntax is \n run <operationName> [parameter1] [parameter2]") public class RunCommand extends Command
Command to run an MBean operation
Author:
Jiaqi Guo
  • Constructor Details

    • RunCommand

      public RunCommand()
  • Method Details

    • doSuggestArgument

      public List<String> doSuggestArgument() throws IOException, JMException
      Description copied from class: Command
      Provide a list of possible arguments for auto completion. This method returns list of arguments(not option) and is called when user presses tab key.
      Overrides:
      doSuggestArgument in class Command
      Returns:
      List of possible arguments used by auto completion or NULL
      Throws:
      IOException - IO errors
      JMException - JMX problemo
    • execute

      public void execute() throws MalformedObjectNameException, IOException, JMException
      Description copied from class: Command
      Execute command
      Specified by:
      execute in class Command
      Throws:
      IOException - IO errors
      JMException - JMX errors
      MalformedObjectNameException
    • setBean

      @Option(name="b", longName="bean", description="MBean to invoke") public final void setBean(String bean)
      Parameters:
      bean - Bean under which the operation is
    • setDomain

      @Option(name="d", longName="domain", description="Domain of MBean to invoke") public final void setDomain(String domain)
      Parameters:
      domain - Domain under which is bean is
    • setMeasure

      @Option(name="m", longName="measure", description="Measure the time spent on the invocation of operation") public final void setMeasure(boolean measure)
      Parameters:
      measure - True if you want to display latency
    • setTypes

      @Option(name="t", longName="types", description="Require parameters to have specific types (comma separated)") public final void setTypes(String types)
    • setParameters

      @MultiValue(listType=java.util.ArrayList.class, minValues=1) @Argument(description="The first parameter is operation name, which is followed by list of arguments") public final void setParameters(List<String> parameters)
      Parameters:
      parameters - List of parameters. The first parameter is operation name
    • setShowQuotationMarks

      @Option(name="q", longName="quots", description="Flag for quotation marks") public final void setShowQuotationMarks(boolean showQuotationMarks)
      Parameters:
      showQuotationMarks - True if output is surrounded by quotation marks