|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvoldemort.utils.JmxUtils
public class JmxUtils
JMX helper functions These rely on annotations to create MBeans. Would be easier to just use the annotations in Java 6, but we don't want to require Java 6 just for our own convenience. Hence reinventing the wheel.
Field Summary | |
---|---|
static java.lang.String |
MBEAN_NAME_SEPARATOR
|
Constructor Summary | |
---|---|
JmxUtils()
|
Method Summary | |
---|---|
static javax.management.modelmbean.ModelMBean |
createModelMBean(java.lang.Object o)
Create a model mbean from an object using the description given in the Jmx annotation if present. |
static javax.management.ObjectName |
createObjectName(java.lang.Class<?> c)
Create an ObjectName from a class |
static javax.management.ObjectName |
createObjectName(java.lang.String domain,
java.lang.String type)
Create a JMX ObjectName |
static javax.management.modelmbean.ModelMBeanAttributeInfo[] |
extractAttributeInfo(java.lang.Object object)
Extract all operations from the given object that have been annotated with the Jmx annotation. |
static javax.management.modelmbean.ModelMBeanOperationInfo[] |
extractOperationInfo(java.lang.Object object)
Extract all operations and attributes from the given object that have been annotated with the Jmx annotation. |
static javax.management.MBeanParameterInfo[] |
extractParameterInfo(java.lang.reflect.Method m)
Extract the parameters from a method using the Jmx annotation if present, or just the raw types otherwise |
static java.lang.String |
getClassName(java.lang.Class<?> c)
Get the class name without the package |
static java.lang.String |
getJmxId(int jmxId)
Return the string representation of jmxId |
static java.lang.String |
getPackageName(java.lang.Class<?> c)
Get the package for this class |
static void |
registerMbean(javax.management.MBeanServer server,
javax.management.modelmbean.ModelMBean mbean,
javax.management.ObjectName name)
Register the given mbean with the server |
static void |
registerMbean(java.lang.Object mbean,
javax.management.ObjectName name)
Register the given mbean with the platform mbean server |
static javax.management.ObjectName |
registerMbean(java.lang.String typeName,
java.lang.Object obj)
Register the given object under the package name of the object's class with the given type name. |
static void |
unregisterMbean(javax.management.MBeanServer server,
javax.management.ObjectName name)
Unregister the mbean with the given name |
static void |
unregisterMbean(javax.management.ObjectName name)
Unregister the mbean with the given name from the platform mbean server |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MBEAN_NAME_SEPARATOR
Constructor Detail |
---|
public JmxUtils()
Method Detail |
---|
public static javax.management.modelmbean.ModelMBean createModelMBean(java.lang.Object o)
o
- The object to create an MBean for
public static javax.management.modelmbean.ModelMBeanOperationInfo[] extractOperationInfo(java.lang.Object object)
object
- The object to process
public static javax.management.modelmbean.ModelMBeanAttributeInfo[] extractAttributeInfo(java.lang.Object object)
object
- The object to process
public static javax.management.MBeanParameterInfo[] extractParameterInfo(java.lang.reflect.Method m)
m
- The method to extract parameters from
public static javax.management.ObjectName createObjectName(java.lang.String domain, java.lang.String type)
domain
- The domain of the objecttype
- The type of the object
public static javax.management.ObjectName createObjectName(java.lang.Class<?> c)
c
- The class
public static java.lang.String getPackageName(java.lang.Class<?> c)
c
- The class
public static java.lang.String getClassName(java.lang.Class<?> c)
c
- The class name with package
public static void registerMbean(java.lang.Object mbean, javax.management.ObjectName name)
mbean
- The mbean to registername
- The name to register underpublic static javax.management.ObjectName registerMbean(java.lang.String typeName, java.lang.Object obj)
typeName
- The name of the type to registerobj
- The object to register as an mbeanpublic static void registerMbean(javax.management.MBeanServer server, javax.management.modelmbean.ModelMBean mbean, javax.management.ObjectName name)
server
- The server to register withmbean
- The mbean to registername
- The name to register underpublic static void unregisterMbean(javax.management.MBeanServer server, javax.management.ObjectName name)
server
- The server to unregister fromname
- The name of the mbean to unregisterpublic static void unregisterMbean(javax.management.ObjectName name)
name
- The name of the mbean to unregisterpublic static java.lang.String getJmxId(int jmxId)
jmxId
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |