org.jboss.byteman.sample.helper
Class JMXHelper

java.lang.Object
  extended by org.jboss.byteman.rule.helper.Helper
      extended by org.jboss.byteman.sample.helper.JMXHelper
All Implemented Interfaces:
javax.management.DynamicMBean

public class JMXHelper
extends Helper
implements javax.management.DynamicMBean

A variant of PeriodicHelper which publishes its stats via JMX


Field Summary
static long DEFAULT_PERIOD
          the default period which the helper will wait for between calls to periodicUpdate in milliseconds.
static java.lang.String DEFAULT_RMI_HOST
          default value for the rmi server host address used by the JMX onnector server used only if an rmi server is required for the JMXConnector
static int DEFAULT_RMI_PORT
          default value for the rmi server port used by the JMX connector server used only if an rmi server is required for the JMXConnector
static int DEFAULT_SAMPLE_SET_SIZE
          default number of samples we are willing to store in order to maintain a running count of all previous
static java.lang.String JMX_URL
          JMX Url pattern for use when creating the connector server
static java.lang.String SYSPROP_MBEAN_SERVER
          This is a system property whose value will determine which MBean Server the MBeans should be registered in.
 
Fields inherited from class org.jboss.byteman.rule.helper.Helper
rule
 
Constructor Summary
JMXHelper(Rule rule)
          constructor allowing this helper to be used as a helper
 
Method Summary
static void activated()
          helper activation method which creates a periodic helper thread to perform periodic calls to the trigger method.
static void deactivated()
          helper deactivation method which shuts down the periodic helper thread.
 java.lang.Object getAttribute(java.lang.String attribute)
           
 javax.management.AttributeList getAttributes(java.lang.String[] attributes)
           
 javax.management.MBeanInfo getMBeanInfo()
           
 java.lang.Object getValue(int idx)
          getter for counter values used by MBean code
 java.lang.Object invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature)
           
 void setAttribute(javax.management.Attribute attribute)
           
 javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
           
 
Methods inherited from class org.jboss.byteman.rule.helper.Helper
addCountDown, callerCheck, callerEquals, callerEquals, callerEquals, callerEquals, callerEquals, callerEquals, callerEquals, callerEquals, callerEquals, callerMatches, callerMatches, callerMatches, callerMatches, callerMatches, callerMatches, callerMatches, callerMatches, callerMatches, clear, closeTrace, countDown, createCountDown, createCounter, createCounter, createJoin, createRendezvous, createRendezvous, createTimer, debug, decrementCounter, delay, deleteCounter, deleteRendezvous, deleteTimer, flag, flagged, formatStack, formatStack, formatStack, formatStack, formatStackBetween, formatStackBetween, formatStackBetween, formatStackBetween, formatStackBetween, formatStackBetween, formatStackBetweenMatches, formatStackBetweenMatches, formatStackBetweenMatches, formatStackBetweenMatches, formatStackBetweenMatches, formatStackBetweenMatches, formatStackMatching, formatStackMatching, formatStackMatching, formatStackMatching, formatStackMatching, formatStackMatching, formatStackRange, getCountDown, getElapsedTimeFromTimer, getRendezvous, getStack, incrementCounter, incrementCounter, installed, isCountDown, isJoin, isRendezvous, joinEnlist, joinWait, killJVM, killJVM, killThread, matchIndex, openTrace, openTrace, printFrame, printlnFrame, readCounter, readCounter, rendezvous, resetTimer, setTriggering, signalKill, signalKill, signalThrow, signalThrow, signalWake, signalWake, toString, trace, trace, traceClose, traceln, traceln, traceOpen, traceOpen, traceStack, traceStack, traceStack, traceStack, traceStack, traceStack, traceStackBetween, traceStackBetween, traceStackBetween, traceStackBetween, traceStackBetween, traceStackBetween, traceStackBetween, traceStackBetween, traceStackBetween, traceStackBetweenMatches, traceStackBetweenMatches, traceStackBetweenMatches, traceStackBetweenMatches, traceStackBetweenMatches, traceStackBetweenMatches, traceStackBetweenMatches, traceStackBetweenMatches, traceStackBetweenMatches, traceStackMatching, traceStackMatching, traceStackMatching, traceStackMatching, traceStackMatching, traceStackMatching, traceStackMatching, traceStackMatching, traceStackMatching, traceStackRange, triggerIndex, uninstalled, waitFor, waitFor, waiting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SYSPROP_MBEAN_SERVER

public static final java.lang.String SYSPROP_MBEAN_SERVER
This is a system property whose value will determine which MBean Server the MBeans should be registered in. If the system property is not defined, the default will be the platform MBeanServer itself. If this system property is set, it will be assumed to be a default domain name of an existing MBeanServer. The existing MBeanServer with that default domain name will be used to house the MBeans. If there is no existing MBeanServer with the given default domain name, one will be created. Note that if this sysprop has the special value "*platform*", then the platform MBeanServer will be used (i.e. it will be as if this sysprop was not set).

See Also:
Constant Field Values

DEFAULT_PERIOD

public static final long DEFAULT_PERIOD
the default period which the helper will wait for between calls to periodicUpdate in milliseconds. this can be redefined either by overriding defaultPeriod

See Also:
Constant Field Values

DEFAULT_SAMPLE_SET_SIZE

public static final int DEFAULT_SAMPLE_SET_SIZE
default number of samples we are willing to store in order to maintain a running count of all previous

See Also:
Constant Field Values

DEFAULT_RMI_HOST

public static final java.lang.String DEFAULT_RMI_HOST
default value for the rmi server host address used by the JMX onnector server used only if an rmi server is required for the JMXConnector

See Also:
Constant Field Values

DEFAULT_RMI_PORT

public static final int DEFAULT_RMI_PORT
default value for the rmi server port used by the JMX connector server used only if an rmi server is required for the JMXConnector

See Also:
Constant Field Values

JMX_URL

public static final java.lang.String JMX_URL
JMX Url pattern for use when creating the connector server

See Also:
Constant Field Values
Constructor Detail

JMXHelper

public JMXHelper(Rule rule)
constructor allowing this helper to be used as a helper

Parameters:
rule -
Method Detail

activated

public static void activated()
helper activation method which creates a periodic helper thread to perform periodic calls to the trigger method. should only be called when synchronized on PeriodicHelper.class.


deactivated

public static void deactivated()
helper deactivation method which shuts down the periodic helper thread. will only be called when synchronized on PeriodicHelper.class


getAttribute

public java.lang.Object getAttribute(java.lang.String attribute)
                              throws javax.management.AttributeNotFoundException,
                                     javax.management.MBeanException,
                                     javax.management.ReflectionException
Specified by:
getAttribute in interface javax.management.DynamicMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionException

setAttribute

public void setAttribute(javax.management.Attribute attribute)
                  throws javax.management.AttributeNotFoundException,
                         javax.management.InvalidAttributeValueException,
                         javax.management.MBeanException,
                         javax.management.ReflectionException
Specified by:
setAttribute in interface javax.management.DynamicMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException

getAttributes

public javax.management.AttributeList getAttributes(java.lang.String[] attributes)
Specified by:
getAttributes in interface javax.management.DynamicMBean

setAttributes

public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
Specified by:
setAttributes in interface javax.management.DynamicMBean

invoke

public java.lang.Object invoke(java.lang.String actionName,
                               java.lang.Object[] params,
                               java.lang.String[] signature)
                        throws javax.management.MBeanException,
                               javax.management.ReflectionException
Specified by:
invoke in interface javax.management.DynamicMBean
Throws:
javax.management.MBeanException
javax.management.ReflectionException

getMBeanInfo

public javax.management.MBeanInfo getMBeanInfo()
Specified by:
getMBeanInfo in interface javax.management.DynamicMBean

getValue

public java.lang.Object getValue(int idx)
getter for counter values used by MBean code



Copyright © 2011. All Rights Reserved.