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

The following examples show how to use javax.management.MBeanInfo#getClassName() . 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
Source File: MBeanIntrospector.java    From jdk1.8-source-analysis with Apache License 2.0 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 2
Source File: MBeanIntrospector.java    From dragonwell8_jdk with GNU General Public License v2.0 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 3
Source File: MBeanIntrospector.java    From jdk8u_jdk with GNU General Public License v2.0 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 4
Source File: MBeanIntrospector.java    From TencentKona-8 with GNU General Public License v2.0 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 5
Source File: MBeanIntrospector.java    From jdk8u60 with GNU General Public License v2.0 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 6
Source File: MBeanIntrospector.java    From JDKSourceCode1.8 with 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
Source File: MBeanIntrospector.java    From jdk8u-jdk with GNU General Public License v2.0 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 8
Source File: MBeanIntrospector.java    From openjdk-8 with GNU General Public License v2.0 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 9
Source File: MBeanIntrospector.java    From openjdk-jdk8u with GNU General Public License v2.0 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 10
Source File: MBeanIntrospector.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 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 11
Source File: StandardMBeanSupport.java    From jdk8u-jdk with GNU General Public License v2.0 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 12
Source File: StandardMBeanSupport.java    From openjdk-jdk9 with GNU General Public License v2.0 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 13
Source File: StandardMBeanSupport.java    From jdk8u-dev-jdk with GNU General Public License v2.0 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
Source File: StandardMBeanSupport.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 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 15
Source File: StandardMBeanSupport.java    From openjdk-jdk8u with GNU General Public License v2.0 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 16
Source File: StandardMBeanSupport.java    From JDKSourceCode1.8 with 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 17
Source File: StandardMBeanSupport.java    From jdk8u-jdk with GNU General Public License v2.0 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 18
Source File: StandardMBeanSupport.java    From jdk1.8-source-analysis with Apache License 2.0 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 19
Source File: JMXTest.java    From gemfirexd-oss with 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 File: JMXTest.java    From gemfirexd-oss with 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);
    }
}