Java Code Examples for javax.management.modelmbean.ModelMBeanOperationInfo#ACTION

The following examples show how to use javax.management.modelmbean.ModelMBeanOperationInfo#ACTION . 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: TestModelMBean.java    From wildfly-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
public MBeanInfo getMBeanInfo() {
    try {
        ModelMBeanAttributeInfo[] attributes = new ModelMBeanAttributeInfo[0];
        ModelMBeanConstructorInfo[] constructors = new ModelMBeanConstructorInfo[] {
                new ModelMBeanConstructorInfo("-", this.getClass().getConstructor())
        };
        ModelMBeanOperationInfo[] operations = new ModelMBeanOperationInfo[] {
                new ModelMBeanOperationInfo("info", "-", new MBeanParameterInfo[0], Void.class.getName(), ModelMBeanOperationInfo.INFO),
                new ModelMBeanOperationInfo("action", "-", new MBeanParameterInfo[0], Void.class.getName(), ModelMBeanOperationInfo.ACTION),
                new ModelMBeanOperationInfo("actionInfo", "-", new MBeanParameterInfo[0], Void.class.getName(), ModelMBeanOperationInfo.ACTION_INFO),
                new ModelMBeanOperationInfo("unknown", "-", new MBeanParameterInfo[0], Void.class.getName(), ModelMBeanOperationInfo.UNKNOWN)
        };
        ModelMBeanNotificationInfo[] notifications = new ModelMBeanNotificationInfo[0];
        return new ModelMBeanInfoSupport(this.getClass().getName(), "-", attributes, constructors, operations, notifications);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}