Java 8 DynamicMBean - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 DynamicMBean class.

This code example shows how to use the following methods:getMBeanInfo
 
        if (mbeans.containsKey(name)) {
            throw new InstanceAlreadyExistsException(format("MBean already registered: %s", name));
        } 
 
        mbeans.put(name, mbean);
 
        return new ObjectInstance(name, mbean.getMBeanInfo().getClassName());
    } 
 
    public void unregisterMBean(ObjectName name)
            throws InstanceNotFoundException
    { 
        if (mbeans.remove(name) == null) {
            throw new InstanceNotFoundException(format("MBean not found: %s", name));
        } 
    } 
 
    public ObjectInstance getObjectInstance(ObjectName name)
            throws InstanceNotFoundException
5
CodeRank
This code example shows how to use the following methods:getAttribute, getAttributes, getMBeanInfo
5
CodeRank
This code example shows how to use the following methods:getMBeanInfo
    /** 
     * Create an {@link ObjectName} with the class name of the MBean implementation as key <em>type</em>. 
     * @see com.picocontainer.gems.jmx.ObjectNameFactory#create(java.lang.Object, javax.management.DynamicMBean) 
     */ 
    public ObjectName create(final Object key, final DynamicMBean mBean) throws MalformedObjectNameException {
        final String className = mBean.getMBeanInfo().getClassName();
        return new ObjectName(getDomain(), "type", className.substring(className.lastIndexOf('.') + 1));
    } 
 
} 
4
CodeRank
See Code Examples for Java 8 DynamicMBean Methods: