com.j256.simplejmx.client
Class CommandLineJmxClient

java.lang.Object
  extended by com.j256.simplejmx.client.CommandLineJmxClient

public class CommandLineJmxClient
extends Object

Command-line client that can be used to support interactive or batch-file JMX operations.

See the helpOutput() and exampleOutput() methods for extensive help/usage information.

Author:
graywatson

Constructor Summary
CommandLineJmxClient(int port)
          Create a command line interface connected to the local host at a certain port number.
CommandLineJmxClient(JmxClient jmxClient)
          Create a command line interface on the passed in client.
CommandLineJmxClient(String jmxUrl)
          Create a command line interface connected to a JMX server using the full JMX URL format.
CommandLineJmxClient(String host, int port)
          Create a command line interface connected to a host and port combination.
 
Method Summary
 void close()
          Close the associated Jmx client
 void runBatchFile(File batchFile)
          Read in commands from the batch-file and execute them.
 void runCommandLine()
          Run the Jmx command line client reading commands from System.in.
 void runCommands(String[] commands)
          Run commands from the String array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandLineJmxClient

public CommandLineJmxClient(JmxClient jmxClient)
Create a command line interface on the passed in client.


CommandLineJmxClient

public CommandLineJmxClient(int port)
                     throws JMException
Create a command line interface connected to the local host at a certain port number.

Throws:
JMException

CommandLineJmxClient

public CommandLineJmxClient(String host,
                            int port)
                     throws JMException
Create a command line interface connected to a host and port combination.

Throws:
JMException

CommandLineJmxClient

public CommandLineJmxClient(String jmxUrl)
                     throws JMException
Create a command line interface connected to a JMX server using the full JMX URL format. The URL should look something like:

 service:jmx:rmi:///jndi/rmi://hostName:portNumber/jmxrmi
 

Throws:
JMException
Method Detail

runCommands

public void runCommands(String[] commands)
                 throws IOException
Run commands from the String array.

Throws:
IOException

runBatchFile

public void runBatchFile(File batchFile)
                  throws IOException
Read in commands from the batch-file and execute them.

Throws:
IOException

runCommandLine

public void runCommandLine()
                    throws IOException
Run the Jmx command line client reading commands from System.in.

Throws:
IOException

close

public void close()
Close the associated Jmx client



This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.