get Attribute from MBeanServerConnection - Java javax.management

Java examples for javax.management:MBean

Description

get Attribute from MBeanServerConnection

Demo Code


//package com.java2s;
import javax.management.MBeanServerConnection;

import javax.management.ObjectName;

public class Main {
    @SuppressWarnings("unchecked")
    public static <T> T getAttribute(MBeanServerConnection connection,
            ObjectName objectName, String attribute) throws Exception {
        return (T) connection.getAttribute(objectName, attribute);
    }/*  w ww.j a v a 2 s  .c  om*/
}

Related Tutorials