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

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

public class Poll
extends AbstractCommand

Polls multiple J2EE servers at the given period.


Field Summary
private  org.apache.commons.cli.CommandLine commandLine
          Command line arguments.
private  java.lang.String graphDef
          Graph definitions, null for no graph output.
private  boolean isCpuSunOption
          Print statistics on the CPU usage ?
private  boolean isDataSourceOption
          Prints statistics on datasources ?
private  boolean isDtdOption
          Print DTD for the graph XML format ?
private  boolean isEntityOption
          Print statistics on entity EJBs ?
private  boolean isHttpOption
          Print statistics on Http/AJP connectors ?
private  boolean isJCACFSourceOption
          Print statistics on JCA connection factories ?
private  boolean isServerOption
          Print overall statistics ?
private  boolean isServletOption
          Print statistics on servlets ?
private  boolean isStatefulOption
          Print statistics on stateful session EJBs ?
private  boolean isStatelessOption
          Print statistics on stateless session EJBs ?
private  boolean isTxOption
          Print statistics on transactions ?
private  java.lang.String jasmineURI
          URI of the JASMINe event switch, null for no JASMINe output.
private  java.lang.String onPattern
          Object name filtering pattern.
private  org.apache.commons.cli.Options options
          List of options that should be parsed from the command line.
private  java.lang.String outputFilePath
          Output file path, null for no file output.
private  long period
          Poll period in seconds.
private  java.lang.String separator
          Separator to use.
 
Fields inherited from class org.ow2.jasmine.monitoring.mbeancmd.AbstractCommand
arguments, name, simpleDateFormat
 
Constructor Summary
Poll()
          Constructor: calls setOptions().
 
Method Summary
 void exec()
          Implementation of inherited abstract method.
 void help()
          Calls AbstractCommand.help() followed by printDtd().
static void main(java.lang.String[] args)
          Tests the Poll implementation.
 void parseCommandLine(java.lang.String[] args)
          Parses the command line arguments into commandLine.
private  void printDtd()
          Prints out the DTD for graph XML.
private  void setOptions()
          Sets all options that are parseable from the command line.
 java.lang.String summary()
          Implementation of inherited abstract method.
 
Methods inherited from class org.ow2.jasmine.monitoring.mbeancmd.AbstractCommand
Exit, getHelpDoc, getName, setArgs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

options

private org.apache.commons.cli.Options options
List of options that should be parsed from the command line.


commandLine

private org.apache.commons.cli.CommandLine commandLine
Command line arguments.


period

private long period
Poll period in seconds.


isHttpOption

private boolean isHttpOption
Print statistics on Http/AJP connectors ?


isServerOption

private boolean isServerOption
Print overall statistics ?


isTxOption

private boolean isTxOption
Print statistics on transactions ?


isCpuSunOption

private boolean isCpuSunOption
Print statistics on the CPU usage ?


isDataSourceOption

private boolean isDataSourceOption
Prints statistics on datasources ?


isJCACFSourceOption

private boolean isJCACFSourceOption
Print statistics on JCA connection factories ?


isServletOption

private boolean isServletOption
Print statistics on servlets ?


isStatelessOption

private boolean isStatelessOption
Print statistics on stateless session EJBs ?


isStatefulOption

private boolean isStatefulOption
Print statistics on stateful session EJBs ?


isEntityOption

private boolean isEntityOption
Print statistics on entity EJBs ?


graphDef

private java.lang.String graphDef
Graph definitions, null for no graph output.


outputFilePath

private java.lang.String outputFilePath
Output file path, null for no file output.


jasmineURI

private java.lang.String jasmineURI
URI of the JASMINe event switch, null for no JASMINe output.


isDtdOption

private boolean isDtdOption
Print DTD for the graph XML format ?


onPattern

private java.lang.String onPattern
Object name filtering pattern.


separator

private java.lang.String separator
Separator to use.

Constructor Detail

Poll

public Poll()
Constructor: calls setOptions().

Method Detail

exec

public void exec()
Implementation of inherited abstract method. Will never return except in the case of failure.

Specified by:
exec in interface Command
Specified by:
exec in class AbstractCommand
See Also:
AbstractCommand.exec()

help

public void help()
Calls AbstractCommand.help() followed by printDtd().

Specified by:
help in interface Command
Overrides:
help in class AbstractCommand
See Also:
Command.help(), AbstractCommand.getHelpDoc()

printDtd

private void printDtd()
Prints out the DTD for graph XML.


summary

public java.lang.String summary()
Implementation of inherited abstract method.

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

main

public static void main(java.lang.String[] args)
Tests the Poll implementation.

Parameters:
args - Arguments to pass to Poll#setArgs.

parseCommandLine

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

Parameters:
args - Arguments to parse.
Throws:
org.apache.commons.cli.ParseException - If parsing fails.

setOptions

private void setOptions()
Sets all options that are parseable from the command line.

See Also:
options