Package org.cyclopsgroup.jmxterm.cmd
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProvide a list of possible arguments for auto completion.voidexecute()Execute commandfinal voidfinal voidfinal voidsetMeasure(boolean measure) final voidsetParameters(List<String> parameters) final voidsetShowQuotationMarks(boolean showQuotationMarks) final voidMethods inherited from class org.cyclopsgroup.jmxterm.Command
doSuggestOption, getSession, isHelp, setHelp, setSession, suggestArgument, suggestOption
-
Constructor Details
-
RunCommand
public RunCommand()
-
-
Method Details
-
doSuggestArgument
Description copied from class:CommandProvide 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:
doSuggestArgumentin classCommand- Returns:
- List of possible arguments used by auto completion or NULL
- Throws:
IOException- IO errorsJMException- JMX problemo
-
execute
Description copied from class:CommandExecute command- Specified by:
executein classCommand- Throws:
IOException- IO errorsJMException- JMX errorsMalformedObjectNameException
-
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
-