@Cli(name="bean",
description="Display or set current selected MBean. ",
note="Without any parameter, it displays current selected bean, otherwise it selects the bean defined by the first parameter. eg. bean java.lang:type=Memory")
public class BeanCommand
extends Command
| Constructor and Description |
|---|
BeanCommand() |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
doSuggestArgument()
Provide a list of possible arguments for auto completion.
|
List<String> |
doSuggestOption(String optionName)
Provide a list of possible option values for auto completion
|
void |
execute()
Execute command
|
static String |
getBeanName(String bean,
String domain,
Session session)
Get full MBean name with given bean name, domain and session
|
void |
setBean(String bean)
Set bean option
|
void |
setDomain(String domain)
Set domain option
|
getSession, isHelp, setHelp, setSession, suggestArgument, suggestOptionpublic static String getBeanName(String bean, String domain, Session session) throws JMException, IOException
bean - Name of bean. It can be NULL so that session#getBean() is returneddomain - Domain for beansession - Current sessionJMException - Thrown when given MBean name is malformedIOException - allows IO exceptions.public List<String> doSuggestArgument() throws IOException, MalformedObjectNameException
CommanddoSuggestArgument in class CommandIOException - IO errorsMalformedObjectNameExceptionpublic List<String> doSuggestOption(String optionName) throws IOException
CommanddoSuggestOption in class CommandoptionName - Name of optionIOException - Network communication errorspublic void execute()
throws IOException,
JMException
Commandexecute in class CommandIOException - IO errorsJMException - JMX errors@Argument(displayName="bean",
description="MBean name with or without domain")
public final void setBean(String bean)
bean - Bean to set@Option(name="d",
longName="domain",
description="Domain name")
public final void setDomain(String domain)
domain - Domain option to setCopyright © 2008–2019. All rights reserved.