com.atlassian.plugin.jmx
Class JmxUtil

java.lang.Object
  extended by com.atlassian.plugin.jmx.JmxUtil

public class JmxUtil
extends Object


Constructor Summary
JmxUtil()
           
 
Method Summary
static ObjectName objectName(AtomicInteger counter, String type)
          Obtain a JMX ObjectName for a new instance of a given type.
static ObjectInstance register(Object object, ObjectName objectName)
          Register a JMX MBean against a given ObjectName.
static boolean unregister(ObjectName objectName)
          Unregister the JMX MBean with a given ObjectName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmxUtil

public JmxUtil()
Method Detail

objectName

public static ObjectName objectName(AtomicInteger counter,
                                    String type)
Obtain a JMX ObjectName for a new instance of a given type.

Parameters:
counter - a counter used to ensure a unique instance id amongst instances with given type.
type - the friendly type name for the instance.
Returns:
a JMX ObjectName for the instance, or null if creation fails.

register

public static ObjectInstance register(Object object,
                                      ObjectName objectName)
Register a JMX MBean against a given ObjectName.

This is simply an error logging wrapper around MBeanServer.registerMBean(java.lang.Object, javax.management.ObjectName).

Parameters:
object - the MBean implementation to register.
objectName - the ObjectName to register against.
Returns:
the ObjectInstance encapsulating the registration, or null if registration failed.

unregister

public static boolean unregister(ObjectName objectName)
Unregister the JMX MBean with a given ObjectName.

This is simply an error logging wrapper around MBeanServer.unregisterMBean(javax.management.ObjectName).

Parameters:
objectName - the ObjectName of the MBean to unregister.
Returns:
true if unregister succeeded, or false if unregister failed.


Copyright © 2015 Atlassian. All rights reserved.