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

The following examples show how to use javax.management.MBeanInfo#getConstructors() . 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 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 2
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 3
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 4
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 5
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 6
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 7
Source File: MBeanIntrospector.java    From openjdk-jdk9 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 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 9
Source File: MXBeanInteropTest2.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
private void printMBeanInfo(MBeanInfo mbInfo) {
    System.out.println("Description " + mbInfo.getDescription());

    for (MBeanConstructorInfo ctor : mbInfo.getConstructors()) {
        System.out.println("Constructor " + ctor.getName());
    }

    for (MBeanAttributeInfo att : mbInfo.getAttributes()) {
        System.out.println("Attribute " + att.getName()
        + " [" + att.getType() + "]");
    }

    for (MBeanOperationInfo oper : mbInfo.getOperations()) {
        System.out.println("Operation " + oper.getName());
    }

    for (MBeanNotificationInfo notif : mbInfo.getNotifications()) {
        System.out.println("Notification " + notif.getName());
    }
}
 
Example 10
Source File: MXBeanInteropTest2.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private void printMBeanInfo(MBeanInfo mbInfo) {
    System.out.println("Description " + mbInfo.getDescription());

    for (MBeanConstructorInfo ctor : mbInfo.getConstructors()) {
        System.out.println("Constructor " + ctor.getName());
    }

    for (MBeanAttributeInfo att : mbInfo.getAttributes()) {
        System.out.println("Attribute " + att.getName()
        + " [" + att.getType() + "]");
    }

    for (MBeanOperationInfo oper : mbInfo.getOperations()) {
        System.out.println("Operation " + oper.getName());
    }

    for (MBeanNotificationInfo notif : mbInfo.getNotifications()) {
        System.out.println("Notification " + notif.getName());
    }
}
 
Example 11
Source File: AnnotationTest.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void check(MBeanServer mbs, ObjectName on) throws Exception {
    MBeanInfo mbi = mbs.getMBeanInfo(on);

    // check the MBean itself
    check(mbi);

    // check attributes
    MBeanAttributeInfo[] attrs = mbi.getAttributes();
    for (MBeanAttributeInfo attr : attrs) {
        check(attr);
        if (attr.getName().equals("ReadOnly"))
            check("@Full", attr.getDescriptor(), expectedFullDescriptor);
    }

    // check operations
    MBeanOperationInfo[] ops = mbi.getOperations();
    for (MBeanOperationInfo op : ops) {
        check(op);
        check(op.getSignature());
    }

    MBeanConstructorInfo[] constrs = mbi.getConstructors();
    for (MBeanConstructorInfo constr : constrs) {
        check(constr);
        check(constr.getSignature());
    }
}
 
Example 12
Source File: AnnotationTest.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void check(MBeanServer mbs, ObjectName on) throws Exception {
    MBeanInfo mbi = mbs.getMBeanInfo(on);

    // check the MBean itself
    check(mbi);

    // check attributes
    MBeanAttributeInfo[] attrs = mbi.getAttributes();
    for (MBeanAttributeInfo attr : attrs) {
        check(attr);
        if (attr.getName().equals("ReadOnly"))
            check("@Full", attr.getDescriptor(), expectedFullDescriptor);
    }

    // check operations
    MBeanOperationInfo[] ops = mbi.getOperations();
    for (MBeanOperationInfo op : ops) {
        check(op);
        check(op.getSignature());
    }

    MBeanConstructorInfo[] constrs = mbi.getConstructors();
    for (MBeanConstructorInfo constr : constrs) {
        check(constr);
        check(constr.getSignature());
    }
}
 
Example 13
Source File: StandardMBeanSupport.java    From hottub 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: AnnotationTest.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static void check(MBeanServer mbs, ObjectName on) throws Exception {
    MBeanInfo mbi = mbs.getMBeanInfo(on);

    // check the MBean itself
    check(mbi);

    // check attributes
    MBeanAttributeInfo[] attrs = mbi.getAttributes();
    for (MBeanAttributeInfo attr : attrs) {
        check(attr);
        if (attr.getName().equals("ReadOnly"))
            check("@Full", attr.getDescriptor(), expectedFullDescriptor);
    }

    // check operations
    MBeanOperationInfo[] ops = mbi.getOperations();
    for (MBeanOperationInfo op : ops) {
        check(op);
        check(op.getSignature());
    }

    MBeanConstructorInfo[] constrs = mbi.getConstructors();
    for (MBeanConstructorInfo constr : constrs) {
        check(constr);
        check(constr.getSignature());
    }
}
 
Example 15
Source File: StandardMBeanSupport.java    From openjdk-8-source 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: AnnotationTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void check(MBeanServer mbs, ObjectName on) throws Exception {
    MBeanInfo mbi = mbs.getMBeanInfo(on);

    // check the MBean itself
    check(mbi);

    // check attributes
    MBeanAttributeInfo[] attrs = mbi.getAttributes();
    for (MBeanAttributeInfo attr : attrs) {
        check(attr);
        if (attr.getName().equals("ReadOnly"))
            check("@Full", attr.getDescriptor(), expectedFullDescriptor);
    }

    // check operations
    MBeanOperationInfo[] ops = mbi.getOperations();
    for (MBeanOperationInfo op : ops) {
        check(op);
        check(op.getSignature());
    }

    MBeanConstructorInfo[] constrs = mbi.getConstructors();
    for (MBeanConstructorInfo constr : constrs) {
        check(constr);
        check(constr.getSignature());
    }
}
 
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 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 19
Source File: StandardMBeanSupport.java    From openjdk-8 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 20
Source File: StandardAgent.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
private void printMBeanInfo(ObjectName mbeanObjectName, String mbeanName) {

	echo("\n>>> Getting the management information for the "+ mbeanName +" MBean");
	echo("    using the getMBeanInfo method of the MBeanServer");
	sleep(1000);
	MBeanInfo info = null;
	try {
	    info = server.getMBeanInfo(mbeanObjectName);
	} catch (Exception e) {
	    echo("\t!!! Could not get MBeanInfo object for "+ mbeanName +" !!!");
	    e.printStackTrace();
	    return;
	}
	echo("\nCLASSNAME: \t"+ info.getClassName());
	echo("\nDESCRIPTION: \t"+ info.getDescription());
	echo("\nATTRIBUTES");
	MBeanAttributeInfo[] attrInfo = info.getAttributes();
	if (attrInfo.length>0) {
	    for(int i=0; i<attrInfo.length; i++) {
		echo(" ** NAME: \t"+ attrInfo[i].getName());
		echo("    DESCR: \t"+ attrInfo[i].getDescription());
		echo("    TYPE: \t"+ attrInfo[i].getType() +
		     "\tREAD: "+ attrInfo[i].isReadable() +
		     "\tWRITE: "+ attrInfo[i].isWritable());
	    }
	} else echo(" ** No attributes **");
	echo("\nCONSTRUCTORS");
	MBeanConstructorInfo[] constrInfo = info.getConstructors();
	for(int i=0; i<constrInfo.length; i++) {
	    echo(" ** NAME: \t"+ constrInfo[i].getName());
	    echo("    DESCR: \t"+ constrInfo[i].getDescription());
	    echo("    PARAM: \t"+ constrInfo[i].getSignature().length +" parameter(s)");
	}
	echo("\nOPERATIONS");
	MBeanOperationInfo[] opInfo = info.getOperations();
	if (opInfo.length>0) {
	    for(int i=0; i<opInfo.length; i++) {
		echo(" ** NAME: \t"+ opInfo[i].getName());
		echo("    DESCR: \t"+ opInfo[i].getDescription());
		echo("    PARAM: \t"+ opInfo[i].getSignature().length +" parameter(s)");
	    }
	} else echo(" ** No operations ** ");
	echo("\nNOTIFICATIONS");
	MBeanNotificationInfo[] notifInfo = info.getNotifications();
	if (notifInfo.length>0) {
	    for(int i=0; i<notifInfo.length; i++) {
		echo(" ** NAME: \t"+ notifInfo[i].getName());
		echo("    DESCR: \t"+ notifInfo[i].getDescription());
	    }
	} else echo(" ** No notifications **");
    }