public final class InApplicationMonitorJMXConnector extends Object implements DynamicMBean, ReportableObserver
| Modifier and Type | Field and Description |
|---|---|
private static String |
ACTIVATE |
private static String |
ADD_STATE_VALUES_TO_GRAPHITE |
private static String |
ADD_STATSD_PLUGIN |
private MBeanServer |
beanServer |
private CorePlugin |
corePlugin |
private static String |
DEACTIVATE |
private static String |
DUMP_HISTOGRAM_LIKE_VALUE_ANALYSIS |
private static String |
DUMP_STRING_WRITER |
private static String |
GET_REGISTERED_OBSERVERS |
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 static String |
REMOVE_ALL_PLUGINS |
private Map<String,Reportable> |
reportables |
private static Object |
semaphore |
| Constructor and Description |
|---|
InApplicationMonitorJMXConnector(CorePlugin corePlugin,
JmxAppMon4JNamingStrategy jmxAppMon4JNamingStrategy) |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
void |
addNewReportable(Reportable reportable)
This method is called for each reportable that is registered on the InApplicationMonitor.
|
private void |
addStateValuesToGraphite(String host,
Integer port,
String appName) |
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) |
MBeanInfo |
getMBeanInfo() |
List<String> |
getRegisteredObservers() |
List<String> |
getRegisteredPluginKeys() |
private Object |
getValueForReportable(String attribute) |
Object |
invoke(String actionName,
Object[] params,
String[] signature) |
Boolean |
isMonitorActive() |
private void |
registerJMXStuff()
registers the InApplicationMonitor as JMX MBean on the running JMX
server - if no JMX server is running, one is started automagically.
|
protected void |
registerMBeanOnJMX(Object object,
String name,
String type) |
void |
removeAllReportables() |
void |
setAttribute(Attribute attribute) |
AttributeList |
setAttributes(AttributeList attributes) |
void |
shutdown() |
protected void |
unregisterMBeanOnJMX(Object object,
String name,
String type) |
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 GET_REGISTERED_OBSERVERS
private static final String REMOVE_ALL_PLUGINS
private static final String ADD_STATSD_PLUGIN
private static final String ADD_STATE_VALUES_TO_GRAPHITE
private static final org.apache.log4j.Logger LOG
private static volatile InApplicationMonitorJMXConnector instance
private static final Object semaphore
private final Map<String,Reportable> reportables
private MBeanServer beanServer
private String jmxPrefix
private final CorePlugin corePlugin
public InApplicationMonitorJMXConnector(CorePlugin corePlugin, JmxAppMon4JNamingStrategy jmxAppMon4JNamingStrategy)
public void shutdown()
public void addNewReportable(Reportable reportable)
addNewReportable in interface ReportableObserverpublic void removeAllReportables()
private void registerJMXStuff()
protected void registerMBeanOnJMX(Object object, String name, String type) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException, MalformedObjectNameException
protected void unregisterMBeanOnJMX(Object object, String name, String type) throws InstanceNotFoundException, MBeanRegistrationException, MalformedObjectNameException
private ObjectName createBeanName(String name, String type) throws MalformedObjectNameException
MalformedObjectNameExceptionpublic MBeanInfo getMBeanInfo()
getMBeanInfo in interface DynamicMBeanpublic Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException
getAttribute in interface DynamicMBeanAttributeNotFoundExceptionMBeanExceptionReflectionExceptionpublic AttributeList getAttributes(String[] attributes)
getAttributes in interface DynamicMBeanpublic void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
setAttribute in interface DynamicMBeanAttributeNotFoundExceptionInvalidAttributeValueExceptionMBeanExceptionReflectionExceptionpublic AttributeList setAttributes(AttributeList attributes)
setAttributes in interface DynamicMBeanpublic Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException
invoke in interface DynamicMBeanMBeanExceptionReflectionExceptionprivate void addStatsdPlugin(String host, Integer port, String appName, Double sampleRate)
private void addStateValuesToGraphite(String host, Integer port, String appName)
public String dumpStringWriter()
public void activate()
public void deactivate()
public Boolean isMonitorActive()
Copyright © 2013 Immobilien Scout GmbH. All Rights Reserved.