Java Code Examples for javax.management.MBeanInfo#getClassName()

The following examples show how to use javax.management.MBeanInfo#getClassName() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * Return the MBeanInfo for the given resource, based on the given
 * per-interface data.
 */
final MBeanInfo getMBeanInfo(Object resource, PerInterface<M> perInterface) {
    MBeanInfo mbi =
            getClassMBeanInfo(resource.getClass(), perInterface);
    MBeanNotificationInfo[] notifs = findNotifications(resource);
    if (notifs == null || notifs.length == 0)
        return mbi;
    else {
        return new MBeanInfo(mbi.getClassName(),
                mbi.getDescription(),
                mbi.getAttributes(),
                mbi.getConstructors(),
                mbi.getOperations(),
                notifs,
                mbi.getDescriptor());
    }
}
 
Example 2
/**
 * Return the MBeanInfo for the given resource, based on the given
 * per-interface data.
 */
final MBeanInfo getMBeanInfo(Object resource, PerInterface<M> perInterface) {
    MBeanInfo mbi =
            getClassMBeanInfo(resource.getClass(), perInterface);
    MBeanNotificationInfo[] notifs = findNotifications(resource);
    if (notifs == null || notifs.length == 0)
        return mbi;
    else {
        return new MBeanInfo(mbi.getClassName(),
                mbi.getDescription(),
                mbi.getAttributes(),
                mbi.getConstructors(),
                mbi.getOperations(),
                notifs,
                mbi.getDescriptor());
    }
}
 
Example 3
/**
 * Return the MBeanInfo for the given resource, based on the given
 * per-interface data.
 */
final MBeanInfo getMBeanInfo(Object resource, PerInterface<M> perInterface) {
    MBeanInfo mbi =
            getClassMBeanInfo(resource.getClass(), perInterface);
    MBeanNotificationInfo[] notifs = findNotifications(resource);
    if (notifs == null || notifs.length == 0)
        return mbi;
    else {
        return new MBeanInfo(mbi.getClassName(),
                mbi.getDescription(),
                mbi.getAttributes(),
                mbi.getConstructors(),
                mbi.getOperations(),
                notifs,
                mbi.getDescriptor());
    }
}
 
Example 4
/**
 * Return the MBeanInfo for the given resource, based on the given
 * per-interface data.
 */
final MBeanInfo getMBeanInfo(Object resource, PerInterface<M> perInterface) {
    MBeanInfo mbi =
            getClassMBeanInfo(resource.getClass(), perInterface);
    MBeanNotificationInfo[] notifs = findNotifications(resource);
    if (notifs == null || notifs.length == 0)
        return mbi;
    else {
        return new MBeanInfo(mbi.getClassName(),
                mbi.getDescription(),
                mbi.getAttributes(),
                mbi.getConstructors(),
                mbi.getOperations(),
                notifs,
                mbi.getDescriptor());
    }
}
 
Example 5
/**
 * Return the MBeanInfo for the given resource, based on the given
 * per-interface data.
 */
final MBeanInfo getMBeanInfo(Object resource, PerInterface<M> perInterface) {
    MBeanInfo mbi =
            getClassMBeanInfo(resource.getClass(), perInterface);
    MBeanNotificationInfo[] notifs = findNotifications(resource);
    if (notifs == null || notifs.length == 0)
        return mbi;
    else {
        return new MBeanInfo(mbi.getClassName(),
                mbi.getDescription(),
                mbi.getAttributes(),
                mbi.getConstructors(),
                mbi.getOperations(),
                notifs,
                mbi.getDescriptor());
    }
}
 
Example 6
Source Project: JDKSourceCode1.8   File: MBeanIntrospector.java    License: MIT License 6 votes vote down vote up
/**
 * Return the MBeanInfo for the given resource, based on the given
 * per-interface data.
 */
final MBeanInfo getMBeanInfo(Object resource, PerInterface<M> perInterface) {
    MBeanInfo mbi =
            getClassMBeanInfo(resource.getClass(), perInterface);
    MBeanNotificationInfo[] notifs = findNotifications(resource);
    if (notifs == null || notifs.length == 0)
        return mbi;
    else {
        return new MBeanInfo(mbi.getClassName(),
                mbi.getDescription(),
                mbi.getAttributes(),
                mbi.getConstructors(),
                mbi.getOperations(),
                notifs,
                mbi.getDescriptor());
    }
}
 
Example 7
/**
 * Return the MBeanInfo for the given resource, based on the given
 * per-interface data.
 */
final MBeanInfo getMBeanInfo(Object resource, PerInterface<M> perInterface) {
    MBeanInfo mbi =
            getClassMBeanInfo(resource.getClass(), perInterface);
    MBeanNotificationInfo[] notifs = findNotifications(resource);
    if (notifs == null || notifs.length == 0)
        return mbi;
    else {
        return new MBeanInfo(mbi.getClassName(),
                mbi.getDescription(),
                mbi.getAttributes(),
                mbi.getConstructors(),
                mbi.getOperations(),
                notifs,
                mbi.getDescriptor());
    }
}
 
Example 8
/**
 * Return the MBeanInfo for the given resource, based on the given
 * per-interface data.
 */
final MBeanInfo getMBeanInfo(Object resource, PerInterface<M> perInterface) {
    MBeanInfo mbi =
            getClassMBeanInfo(resource.getClass(), perInterface);
    MBeanNotificationInfo[] notifs = findNotifications(resource);
    if (notifs == null || notifs.length == 0)
        return mbi;
    else {
        return new MBeanInfo(mbi.getClassName(),
                mbi.getDescription(),
                mbi.getAttributes(),
                mbi.getConstructors(),
                mbi.getOperations(),
                notifs,
                mbi.getDescriptor());
    }
}
 
Example 9
/**
 * Return the MBeanInfo for the given resource, based on the given
 * per-interface data.
 */
final MBeanInfo getMBeanInfo(Object resource, PerInterface<M> perInterface) {
    MBeanInfo mbi =
            getClassMBeanInfo(resource.getClass(), perInterface);
    MBeanNotificationInfo[] notifs = findNotifications(resource);
    if (notifs == null || notifs.length == 0)
        return mbi;
    else {
        return new MBeanInfo(mbi.getClassName(),
                mbi.getDescription(),
                mbi.getAttributes(),
                mbi.getConstructors(),
                mbi.getOperations(),
                notifs,
                mbi.getDescriptor());
    }
}
 
Example 10
/**
 * Return the MBeanInfo for the given resource, based on the given
 * per-interface data.
 */
final MBeanInfo getMBeanInfo(Object resource, PerInterface<M> perInterface) {
    MBeanInfo mbi =
            getClassMBeanInfo(resource.getClass(), perInterface);
    MBeanNotificationInfo[] notifs = findNotifications(resource);
    if (notifs == null || notifs.length == 0)
        return mbi;
    else {
        return new MBeanInfo(mbi.getClassName(),
                mbi.getDescription(),
                mbi.getAttributes(),
                mbi.getConstructors(),
                mbi.getOperations(),
                notifs,
                mbi.getDescriptor());
    }
}
 
Example 11
@Override
public MBeanInfo getMBeanInfo() {
    MBeanInfo mbi = super.getMBeanInfo();
    Class<?> resourceClass = getResource().getClass();
    if (StandardMBeanIntrospector.isDefinitelyImmutableInfo(resourceClass))
        return mbi;
    return new MBeanInfo(mbi.getClassName(), mbi.getDescription(),
            mbi.getAttributes(), mbi.getConstructors(),
            mbi.getOperations(),
            MBeanIntrospector.findNotifications(getResource()),
            mbi.getDescriptor());
}
 
Example 12
@Override
public MBeanInfo getMBeanInfo() {
    MBeanInfo mbi = super.getMBeanInfo();
    Class<?> resourceClass = getResource().getClass();
    if (StandardMBeanIntrospector.isDefinitelyImmutableInfo(resourceClass))
        return mbi;
    return new MBeanInfo(mbi.getClassName(), mbi.getDescription(),
            mbi.getAttributes(), mbi.getConstructors(),
            mbi.getOperations(),
            MBeanIntrospector.findNotifications(getResource()),
            mbi.getDescriptor());
}
 
Example 13
Source Project: JDKSourceCode1.8   File: StandardMBeanSupport.java    License: MIT License 5 votes vote down vote up
@Override
public MBeanInfo getMBeanInfo() {
    MBeanInfo mbi = super.getMBeanInfo();
    Class<?> resourceClass = getResource().getClass();
    if (StandardMBeanIntrospector.isDefinitelyImmutableInfo(resourceClass))
        return mbi;
    return new MBeanInfo(mbi.getClassName(), mbi.getDescription(),
            mbi.getAttributes(), mbi.getConstructors(),
            mbi.getOperations(),
            MBeanIntrospector.findNotifications(getResource()),
            mbi.getDescriptor());
}
 
Example 14
@Override
public MBeanInfo getMBeanInfo() {
    MBeanInfo mbi = super.getMBeanInfo();
    Class<?> resourceClass = getResource().getClass();
    if (StandardMBeanIntrospector.isDefinitelyImmutableInfo(resourceClass))
        return mbi;
    return new MBeanInfo(mbi.getClassName(), mbi.getDescription(),
            mbi.getAttributes(), mbi.getConstructors(),
            mbi.getOperations(),
            MBeanIntrospector.findNotifications(getResource()),
            mbi.getDescriptor());
}
 
Example 15
@Override
public MBeanInfo getMBeanInfo() {
    MBeanInfo mbi = super.getMBeanInfo();
    Class<?> resourceClass = getResource().getClass();
    if (StandardMBeanIntrospector.isDefinitelyImmutableInfo(resourceClass))
        return mbi;
    return new MBeanInfo(mbi.getClassName(), mbi.getDescription(),
            mbi.getAttributes(), mbi.getConstructors(),
            mbi.getOperations(),
            MBeanIntrospector.findNotifications(getResource()),
            mbi.getDescriptor());
}
 
Example 16
@Override
public MBeanInfo getMBeanInfo() {
    MBeanInfo mbi = super.getMBeanInfo();
    Class<?> resourceClass = getResource().getClass();
    if (StandardMBeanIntrospector.isDefinitelyImmutableInfo(resourceClass))
        return mbi;
    return new MBeanInfo(mbi.getClassName(), mbi.getDescription(),
            mbi.getAttributes(), mbi.getConstructors(),
            mbi.getOperations(),
            MBeanIntrospector.findNotifications(getResource()),
            mbi.getDescriptor());
}
 
Example 17
@Override
public MBeanInfo getMBeanInfo() {
    MBeanInfo mbi = super.getMBeanInfo();
    Class<?> resourceClass = getResource().getClass();
    if (StandardMBeanIntrospector.isDefinitelyImmutableInfo(resourceClass))
        return mbi;
    return new MBeanInfo(mbi.getClassName(), mbi.getDescription(),
            mbi.getAttributes(), mbi.getConstructors(),
            mbi.getOperations(),
            MBeanIntrospector.findNotifications(getResource()),
            mbi.getDescriptor());
}
 
Example 18
@Override
public MBeanInfo getMBeanInfo() {
    MBeanInfo mbi = super.getMBeanInfo();
    Class<?> resourceClass = getResource().getClass();
    if (StandardMBeanIntrospector.isDefinitelyImmutableInfo(resourceClass))
        return mbi;
    return new MBeanInfo(mbi.getClassName(), mbi.getDescription(),
            mbi.getAttributes(), mbi.getConstructors(),
            mbi.getOperations(),
            MBeanIntrospector.findNotifications(getResource()),
            mbi.getDescriptor());
}
 
Example 19
Source Project: gemfirexd-oss   File: JMXTest.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Test that all MBeans registered by Derby have:
 * <UL>
 * <LI> A type key property correct set.
 * <LI> Expose a class name in com.pivotal.gemfirexd.internal.mbeans.
 * </UL>
 * @throws Exception
 */
public void testDerbyRegisteredMBeansSimpleInfo() throws Exception
{        
    Set<ObjectName> derbyMBeans = getDerbyDomainMBeans();
    
    // We expect Derby to have registered MBeans
    // including a management MBean and the one registered
    // by our setUp method.
    assertTrue("Derby MBEan count:" + derbyMBeans.size(),
            derbyMBeans.size() >= 2);
    
    final MBeanServerConnection jmx = getMBeanServerConnection();
    for (final ObjectName name : derbyMBeans)
    {
        String type = name.getKeyProperty("type");
        // Every Derby MBean has a type.
        assertNotNull(type);
        
        MBeanInfo mbeanInfo = AccessController.doPrivileged(
                new PrivilegedExceptionAction<MBeanInfo>() {
                    public MBeanInfo run() throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException {
                        return jmx.getMBeanInfo(name);
                   }   
                }
            );
        
        String mbeanClassName = mbeanInfo.getClassName();
        // Is the class name in the public api
        assertTrue(mbeanClassName.startsWith("com.pivotal.gemfirexd.internal.mbeans."));
        
        // See if it was the application created ManagementMBean
        // This will have the implementation class registered
        // as the class name since it is not registered by Derby.
        if ("Management".equals(type)
                && "com.pivotal.gemfirexd.internal.mbeans.Management".equals(mbeanClassName))
        {
            continue;
        }
                
        // and is a Derby specific MBean.
        assertTrue(mbeanClassName.endsWith("MBean"));
        
        // Check the type is the class name of the MBean without
        // the MBean and the package.
        String scn = mbeanClassName.substring(mbeanClassName.lastIndexOf('.') + 1);         
        scn = scn.substring(0, scn.length() - "MBean".length());
        assertEquals(scn, type);
    }
}
 
Example 20
Source Project: gemfirexd-oss   File: JMXTest.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Test that all MBeans registered by Derby have:
 * <UL>
 * <LI> A type key property correct set.
 * <LI> Expose a class name in com.pivotal.gemfirexd.internal.mbeans.
 * </UL>
 * @throws Exception
 */
public void testDerbyRegisteredMBeansSimpleInfo() throws Exception
{        
    Set<ObjectName> derbyMBeans = getDerbyDomainMBeans();
    
    // We expect Derby to have registered MBeans
    // including a management MBean and the one registered
    // by our setUp method.
    assertTrue("Derby MBEan count:" + derbyMBeans.size(),
            derbyMBeans.size() >= 2);
    
    final MBeanServerConnection jmx = getMBeanServerConnection();
    for (final ObjectName name : derbyMBeans)
    {
        String type = name.getKeyProperty("type");
        // Every Derby MBean has a type.
        assertNotNull(type);
        
        MBeanInfo mbeanInfo = AccessController.doPrivileged(
                new PrivilegedExceptionAction<MBeanInfo>() {
                    public MBeanInfo run() throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException {
                        return jmx.getMBeanInfo(name);
                   }   
                }
            );
        
        String mbeanClassName = mbeanInfo.getClassName();
        // Is the class name in the public api
        assertTrue(mbeanClassName.startsWith("com.pivotal.gemfirexd.internal.mbeans."));
        
        // See if it was the application created ManagementMBean
        // This will have the implementation class registered
        // as the class name since it is not registered by Derby.
        if ("Management".equals(type)
                && "com.pivotal.gemfirexd.internal.mbeans.Management".equals(mbeanClassName))
        {
            continue;
        }
                
        // and is a Derby specific MBean.
        assertTrue(mbeanClassName.endsWith("MBean"));
        
        // Check the type is the class name of the MBean without
        // the MBean and the package.
        String scn = mbeanClassName.substring(mbeanClassName.lastIndexOf('.') + 1);         
        scn = scn.substring(0, scn.length() - "MBean".length());
        assertEquals(scn, type);
    }
}