org.apache.activemq.console.command
Class AbstractJmxCommand

java.lang.Object
  extended by org.apache.activemq.console.command.AbstractCommand
      extended by org.apache.activemq.console.command.AbstractJmxCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
BrowseCommand, ListCommand, PurgeCommand, QueryCommand, ShutdownCommand

public abstract class AbstractJmxCommand
extends AbstractCommand


Field Summary
static java.lang.String DEFAULT_JMX_URL
           
 
Fields inherited from class org.apache.activemq.console.command.AbstractCommand
COMMAND_OPTION_DELIMETER
 
Constructor Summary
AbstractJmxCommand()
           
 
Method Summary
protected  void closeJmxConnector()
          Close the current JMX connector
protected  javax.management.remote.JMXConnector createJmxConnector()
          Create a JMX connector using the current specified JMX service url.
protected  javax.management.remote.JMXServiceURL getJmxServiceUrl()
          Get the current specified JMX service url.
protected  void handleOption(java.lang.String token, java.util.List tokens)
          Handle the --jmxurl option.
protected  void setJmxServiceUrl(javax.management.remote.JMXServiceURL jmxServiceUrl)
          Sets the JMX service url to use.
protected  void setJmxServiceUrl(java.lang.String jmxServiceUrl)
          Sets the JMX service url to use.
protected  javax.management.remote.JMXServiceURL useJmxServiceUrl()
          Get the current JMX service url being used, or create a default one if no JMX service url has been specified.
 
Methods inherited from class org.apache.activemq.console.command.AbstractCommand
execute, parseOptions, printHelp, runTask
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_JMX_URL

public static final java.lang.String DEFAULT_JMX_URL
See Also:
Constant Field Values
Constructor Detail

AbstractJmxCommand

public AbstractJmxCommand()
Method Detail

getJmxServiceUrl

protected javax.management.remote.JMXServiceURL getJmxServiceUrl()
Get the current specified JMX service url.

Returns:
JMX service url

useJmxServiceUrl

protected javax.management.remote.JMXServiceURL useJmxServiceUrl()
                                                          throws java.net.MalformedURLException
Get the current JMX service url being used, or create a default one if no JMX service url has been specified.

Returns:
JMX service url
Throws:
java.net.MalformedURLException

setJmxServiceUrl

protected void setJmxServiceUrl(javax.management.remote.JMXServiceURL jmxServiceUrl)
Sets the JMX service url to use.

Parameters:
jmxServiceUrl - - new JMX service url to use

setJmxServiceUrl

protected void setJmxServiceUrl(java.lang.String jmxServiceUrl)
                         throws java.net.MalformedURLException
Sets the JMX service url to use.

Parameters:
jmxServiceUrl - - new JMX service url to use
Throws:
java.net.MalformedURLException

createJmxConnector

protected javax.management.remote.JMXConnector createJmxConnector()
                                                           throws java.io.IOException
Create a JMX connector using the current specified JMX service url. If there is an existing connection, it tries to reuse this connection.

Returns:
created JMX connector
Throws:
java.io.IOException

closeJmxConnector

protected void closeJmxConnector()
Close the current JMX connector


handleOption

protected void handleOption(java.lang.String token,
                            java.util.List tokens)
                     throws java.lang.Exception
Handle the --jmxurl option.

Overrides:
handleOption in class AbstractCommand
Parameters:
token - - option token to handle
tokens - - succeeding command arguments
Throws:
java.lang.Exception


Copyright © 2010 Apache Software Foundation. All Rights Reserved.