|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.is24.util.monitoring.jmx.InApplicationMonitorJMXConnector
public final class InApplicationMonitorJMXConnector
This class publishes values registered at the InApplicationMonitor as JMX MBeans. Simple values (Counter, Version, StateValue) are published directly via this class as dynamic MBean, complex types are published using an own MBean for each Reportable.
| Field Summary | |
|---|---|
private static String |
ACTIVATE
|
private static String |
ADD_STATSD_PLUGIN
|
private MBeanServer |
beanServer
|
private static String |
DEACTIVATE
|
private static String |
DUMP_HISTOGRAM_LIKE_VALUE_ANALYSIS
|
private static String |
DUMP_STRING_WRITER
|
private static String |
GET_REGISTERED_PLUGIN_KEYS
|
private static InApplicationMonitorJMXConnector |
instance
|
private static String |
IS_MONITOR_ACTIVE
|
private String |
jmxPrefix
|
private static org.apache.log4j.Logger |
LOG
|
private boolean |
registerAllReportables
|
private static String |
REMOVE_ALL_PLUGINS
|
private Map<String,Reportable> |
reportables
|
private Map<String,String> |
reportablesThatShouldBeRegistered
|
| Constructor Summary | |
|---|---|
private |
InApplicationMonitorJMXConnector(boolean interestedInAllReportables,
String jmxPrefix)
|
| Method Summary | |
|---|---|
void |
activate()
|
void |
addNewReportable(Reportable reportable)
This method is called for each reportable that is registered on the InApplicationMonitor. |
private void |
addStatsdPlugin(String host,
Integer port,
String appName,
Double sampleRate)
|
private ObjectName |
createBeanName(String name,
String type)
|
void |
deactivate()
|
String |
dumpHistogramLikeValueAnalysis(String base)
|
String |
dumpStringWriter()
|
Object |
getAttribute(String attribute)
|
AttributeList |
getAttributes(String[] attributes)
|
static InApplicationMonitorJMXConnector |
getInstance()
|
static InApplicationMonitorJMXConnector |
getInstance(boolean interestedInAllReportables)
singleton access method WARNING : when called, this method registers the InApplicationMonitor as dynamic MBean on the JMX MBean server thing - use after thinking only. |
static InApplicationMonitorJMXConnector |
getInstance(boolean interestedInAllReportables,
JmxAppMon4JNamingStrategy namingStrategy)
singleton access method WARNING : when called, this method registers the InApplicationMonitor as dynamic MBean on the JMX MBean server thing - use after thinking only. |
MBeanInfo |
getMBeanInfo()
|
List<String> |
getRegisteredPluginKeys()
|
private Object |
getValueForReportable(String attribute)
|
Object |
invoke(String actionName,
Object[] params,
String[] signature)
|
Boolean |
isMonitorActive()
|
void |
markCounterForJMX(String string)
Indicates that a reportable should be registered as JMX attribute This method must be called before the reportable is registered at the InApplicationMonitor, otherwise the reportable will not be registered here. |
private void |
registerJMXStuff()
registers the InApplicationMonitor as JMX MBean on the running JMX server - if no JMX server is running, one is started automagically. |
void |
registerMBeanOnJMX(Object object,
String name)
|
void |
registerMBeanOnJMX(Object object,
String name,
String type)
|
private void |
registerReportable(String reportableKey,
Reportable reportable)
|
void |
setAttribute(Attribute attribute)
|
AttributeList |
setAttributes(AttributeList attributes)
|
boolean |
shouldRegisterAllReportables()
|
void |
unregisterMBeanOnJMX(Object object,
String name,
String type)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final String DUMP_STRING_WRITER
private static final String DUMP_HISTOGRAM_LIKE_VALUE_ANALYSIS
private static final String ACTIVATE
private static final String DEACTIVATE
private static final String IS_MONITOR_ACTIVE
private static final String GET_REGISTERED_PLUGIN_KEYS
private static final String REMOVE_ALL_PLUGINS
private static final String ADD_STATSD_PLUGIN
private static final org.apache.log4j.Logger LOG
private static InApplicationMonitorJMXConnector instance
private final Map<String,Reportable> reportables
private final Map<String,String> reportablesThatShouldBeRegistered
private boolean registerAllReportables
private MBeanServer beanServer
private String jmxPrefix
| Constructor Detail |
|---|
private InApplicationMonitorJMXConnector(boolean interestedInAllReportables,
String jmxPrefix)
| Method Detail |
|---|
public static InApplicationMonitorJMXConnector getInstance(boolean interestedInAllReportables,
JmxAppMon4JNamingStrategy namingStrategy)
interestedInAllReportables - set this to true if you want all reportables registered at
the InApplicationMonitor to be available as JMX attributesnamingStrategy - the JmxAppMon4JNamingStrategy alters the standard prefix from "is24" to what is provided by the strategy.
public static InApplicationMonitorJMXConnector getInstance(boolean interestedInAllReportables)
interestedInAllReportables - set this to true if you want all reportables registered at
the InApplicationMonitor to be available as JMX attributes
public static InApplicationMonitorJMXConnector getInstance()
public void markCounterForJMX(String string)
string - name of the reportablepublic void addNewReportable(Reportable reportable)
addNewReportable in interface ReportableObserver
private void registerReportable(String reportableKey,
Reportable reportable)
public boolean shouldRegisterAllReportables()
private void registerJMXStuff()
public void registerMBeanOnJMX(Object object,
String name)
throws InstanceAlreadyExistsException,
MBeanRegistrationException,
NotCompliantMBeanException,
MalformedObjectNameException
InstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException
MalformedObjectNameException
public void registerMBeanOnJMX(Object object,
String name,
String type)
throws InstanceAlreadyExistsException,
MBeanRegistrationException,
NotCompliantMBeanException,
MalformedObjectNameException
InstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException
MalformedObjectNameException
public void unregisterMBeanOnJMX(Object object,
String name,
String type)
throws InstanceNotFoundException,
MBeanRegistrationException,
MalformedObjectNameException
InstanceNotFoundException
MBeanRegistrationException
MalformedObjectNameException
private ObjectName createBeanName(String name,
String type)
throws MalformedObjectNameException
MalformedObjectNameExceptionpublic MBeanInfo getMBeanInfo()
getMBeanInfo in interface DynamicMBeanprivate Object getValueForReportable(String attribute)
public Object getAttribute(String attribute)
throws AttributeNotFoundException,
MBeanException,
ReflectionException
getAttribute in interface DynamicMBeanAttributeNotFoundException
MBeanException
ReflectionExceptionpublic AttributeList getAttributes(String[] attributes)
getAttributes in interface DynamicMBean
public void setAttribute(Attribute attribute)
throws AttributeNotFoundException,
InvalidAttributeValueException,
MBeanException,
ReflectionException
setAttribute in interface DynamicMBeanAttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionExceptionpublic AttributeList setAttributes(AttributeList attributes)
setAttributes in interface DynamicMBean
public Object invoke(String actionName,
Object[] params,
String[] signature)
throws MBeanException,
ReflectionException
invoke in interface DynamicMBeanMBeanException
ReflectionException
private void addStatsdPlugin(String host,
Integer port,
String appName,
Double sampleRate)
public String dumpStringWriter()
public String dumpHistogramLikeValueAnalysis(String base)
public void activate()
public void deactivate()
public Boolean isMonitorActive()
public List<String> getRegisteredPluginKeys()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||