org.ow2.jasmine.monitoring.mbeancmd.commands
Class Mbean

java.lang.Object
  extended by org.ow2.jasmine.monitoring.mbeancmd.AbstractCommand
      extended by org.ow2.jasmine.monitoring.mbeancmd.commands.Mbean
All Implemented Interfaces:
Command

public class Mbean
extends AbstractCommand

Command that can do any given action on any MBean.


Field Summary
protected  JmxAP jmxap
          JMX Access Point.
 
Fields inherited from class org.ow2.jasmine.monitoring.mbeancmd.AbstractCommand
arguments, logger, name, SIMPLEDATEFORMAT
 
Constructor Summary
Mbean()
          Constructor: calls setOptions().
 
Method Summary
 int exec(CommandDispatcher cmdDispatcher)
          Implementation of inherited abstract method.
 void parseCommandLine(java.lang.String[] args)
          Parses the command line arguments into commandLine.
 void process()
          Processes the request.
 java.lang.String summary()
          Implementation of inherited abstract method.
 java.lang.String toString()
           
 
Methods inherited from class org.ow2.jasmine.monitoring.mbeancmd.AbstractCommand
getHelpDoc, getName, help, setArgs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

jmxap

protected JmxAP jmxap
JMX Access Point.

Constructor Detail

Mbean

public Mbean()
Constructor: calls setOptions().

Method Detail

exec

public int exec(CommandDispatcher cmdDispatcher)
Implementation of inherited abstract method. Will never return if a period is set in the command line.

Specified by:
exec in interface Command
Specified by:
exec in class AbstractCommand
Returns:
Will never return if a period is set in the command line. Otherwise, 0 if succeeded, an error code otherwise.
See Also:
AbstractCommand#exec()

summary

public java.lang.String summary()
Implementation of inherited abstract method. Retrieves the command's summary.

Specified by:
summary in interface Command
Specified by:
summary in class AbstractCommand
Returns:
Command's summary.
See Also:
AbstractCommand.summary()

parseCommandLine

public void parseCommandLine(java.lang.String[] args)
                      throws org.apache.commons.cli.ParseException,
                             javax.management.MalformedObjectNameException
Parses the command line arguments into commandLine.

Parameters:
args - Arguments to parse.
Throws:
org.apache.commons.cli.ParseException - If parsing fails.
javax.management.MalformedObjectNameException - Object name given in the command line is invalid.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
Returns stringified on

process

public void process()
             throws java.lang.Exception
Processes the request.

Throws:
java.lang.Exception - If anything fails.


Copyright © 2009 OW2 Consortium. All Rights Reserved.