List of utility methods to do MBean
ObjectName | chooseMBean(Set choose M Bean if (mbeans.size() == 1) { return mbeans.iterator().next(); for (ObjectName mbean : mbeans) { if (!isHawtioDummy(mbean.toString())) { return mbean; return null; |
ObjectName | composeMBeanName(String objTypeName, String objInstanceName) compose M Bean Name String name = "com.cloud:type=" + objTypeName; if (objInstanceName != null && !objInstanceName.isEmpty()) name += ", name=" + objInstanceName; return new ObjectName(name); |
OpenMBeanAttributeInfo | convertToOpenMBeanAttribute(final MBeanAttributeInfo in, final String prefix) convert To Open M Bean Attribute return createOpenMBeanAttributeInfo(getOpenType(in.getType()), in, prefix);
|
OpenMBeanOperationInfo | convertToOpenMBeanOperation(MBeanOperationInfo in) convert To Open M Bean Operation return convertToOpenMBeanOperation(in, null, null);
|
MBeanServer | createMBeanServer() Create and configure (if necessary) and return the MBeanServer with which we will be registering our ModelMBean implementations.
if (mbeanServer == null) { mbeanServer = MBeanServerFactory.createMBeanServer(DEFAULT_DOMAIN); return mbeanServer; |
OpenMBeanAttributeInfo | createOpenMBeanAttributeInfo(final OpenType type, final MBeanAttributeInfo in, final String prefix) create Open M Bean Attribute Info return new OpenMBeanAttributeInfoSupport(((prefix != null) ? prefix + in.getName() : in.getName()), in.getDescription(), type, in.isReadable(), in.isWritable(), in.isIs()); |
Object | createProxy(final ObjectName objectName, final Class mbeanInterface, final MBeanServer mbeanServer) create Proxy return MBeanServerInvocationHandler.newProxyInstance(mbeanServer, objectName, mbeanInterface, false);
|
ObjectInstance | createTimerMBean(ObjectName name, MBeanServer server) create Timer M Bean return server.createMBean(TIMER_MBEAN_CLASSNAME, name, null, null);
|
void | dumpAttributes(MBeanAttributeInfo[] attributes) dump Attributes System.out.println(""); System.out.println("Attributes:"); for (int i = 0; i < attributes.length; i++) { StringBuffer dump = new StringBuffer(); MBeanAttributeInfo attribute = attributes[i]; dump.append("name=").append(attribute.getName()); dump.append(",type=").append(attribute.getType()); dump.append(",readable=").append(attribute.isReadable()); ... |
void | dumpConstructors(MBeanConstructorInfo[] constructors) dump Constructors System.out.println(""); System.out.println("Constructors:"); for (int i = 0; i < constructors.length; i++) { StringBuffer dump = new StringBuffer(); MBeanConstructorInfo constructor = constructors[i]; dump.append("name=").append(constructor.getName()); dump.append(",signature=").append(makeSignatureString(constructor.getSignature())); System.out.println(dump); ... |