public abstract class AbstractJmxCommand extends AbstractCommand
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_JMX_URL |
COMMAND_OPTION_DELIMETER, context| Constructor and Description |
|---|
AbstractJmxCommand() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeJmxConnection()
Close the current JMX connector
|
protected MBeanServerConnection |
createJmxConnection() |
void |
execute(List<String> tokens)
Execute a generic command, which includes parsing the options for the
command and running the specific task.
|
protected String |
findJMXUrlByProcessId(int pid)
Finds the JMX Url for a VM by its process id
|
String |
getJmxPassword()
Get the password used when authenticating
|
protected JMXServiceURL |
getJmxServiceUrl()
Get the current specified JMX service url.
|
String |
getJmxUser()
Get the JMX user name to be used when authenticating.
|
static String |
getJVM() |
protected void |
handleOption(String token,
List<String> tokens)
Handle the --jmxurl option.
|
boolean |
isJmxUseLocal()
Get whether the default mbean server for this JVM should be used instead of the jmx url
|
static boolean |
isSunJVM() |
void |
setJmxPassword(String jmxPassword)
Sets the password to use when authenticating
|
protected void |
setJmxServiceUrl(JMXServiceURL jmxServiceUrl)
Sets the JMX service url to use.
|
protected void |
setJmxServiceUrl(String jmxServiceUrl)
Sets the JMX service url to use.
|
void |
setJmxUseLocal(boolean jmxUseLocal)
Sets whether the the default mbean server for this JVM should be used instead of the jmx url
|
void |
setJmxUser(String jmxUser)
Sets the JMS user name to use
|
protected JMXServiceURL |
useJmxServiceUrl()
Get the current JMX service url being used, or create a default one if no JMX service url has been specified.
|
parseOptions, printHelp, printHelpFromFile, runTask, setCommandContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetName, getOneLineDescriptionpublic static String DEFAULT_JMX_URL
public AbstractJmxCommand()
protected JMXServiceURL getJmxServiceUrl()
public static boolean isSunJVM()
protected String findJMXUrlByProcessId(int pid)
pid - The process id value of the VM to search for.protected JMXServiceURL useJmxServiceUrl() throws MalformedURLException
MalformedURLExceptionprotected void setJmxServiceUrl(JMXServiceURL jmxServiceUrl)
jmxServiceUrl - - new JMX service url to useprotected void setJmxServiceUrl(String jmxServiceUrl) throws MalformedURLException
jmxServiceUrl - - new JMX service url to useMalformedURLExceptionpublic String getJmxUser()
public void setJmxUser(String jmxUser)
jmxUser - - the jmxpublic String getJmxPassword()
public void setJmxPassword(String jmxPassword)
jmxPassword - - the password used for JMX authenticationpublic boolean isJmxUseLocal()
true if the mbean server from this JVM should be used, false if the jmx url should be usedpublic void setJmxUseLocal(boolean jmxUseLocal)
jmxUseLocal - - true if the mbean server from this JVM should be used, false if the jmx url should be usedprotected void closeJmxConnection()
protected MBeanServerConnection createJmxConnection() throws IOException
IOExceptionprotected void handleOption(String token, List<String> tokens) throws Exception
handleOption in class AbstractCommandtoken - - option token to handletokens - - succeeding command argumentsExceptionpublic void execute(List<String> tokens) throws Exception
AbstractCommandexecute in interface Commandexecute in class AbstractCommandtokens - - command argumentsExceptionCopyright © 2005–2015 FuseSource, Corp.. All rights reserved.