Java Code Examples for javax.management.MBeanOperationInfo#ACTION_INFO

The following examples show how to use javax.management.MBeanOperationInfo#ACTION_INFO . 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: MustBeValidCommand.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanOperationInfo[] makeOpInfos(String[][] spec) {
    final MBeanOperationInfo[] result =
        new MBeanOperationInfo[spec.length];
    final MBeanParameterInfo[] pars = makeParInfos(parameters);
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanOperationInfo: " +
                           spec[i][0]);
        final MBeanOperationInfo item =
            new MBeanOperationInfo(spec[i][2],spec[i][0],pars,spec[i][1],
                                   MBeanOperationInfo.ACTION_INFO);
        result[i]=item;
    }
    return result;
}
 
Example 2
Source File: Dynamic.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public MBeanInfo getMBeanInfo() {
    return new MBeanInfo(
            Dynamic.class.getName(), "MBean for RBAC testing of JMX non-core MBeans", null, null,
            new MBeanOperationInfo[] {
                    new MBeanOperationInfo("helloReadOnly", "helloReadOnly", null, "void", MBeanOperationInfo.INFO),
                    new MBeanOperationInfo("helloWriteOnly", "helloWriteOnly", null, "void", MBeanOperationInfo.ACTION),
                    new MBeanOperationInfo("helloReadWrite", "helloReadWrite", null, "void", MBeanOperationInfo.ACTION_INFO),
                    new MBeanOperationInfo("helloUnknown", "helloUnknown", null, "void", MBeanOperationInfo.UNKNOWN)
            },
            null, null
    );
}
 
Example 3
Source File: MustBeValidCommand.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanOperationInfo[] makeOpInfos(String[][] spec) {
    final MBeanOperationInfo[] result =
        new MBeanOperationInfo[spec.length];
    final MBeanParameterInfo[] pars = makeParInfos(parameters);
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanOperationInfo: " +
                           spec[i][0]);
        final MBeanOperationInfo item =
            new MBeanOperationInfo(spec[i][2],spec[i][0],pars,spec[i][1],
                                   MBeanOperationInfo.ACTION_INFO);
        result[i]=item;
    }
    return result;
}
 
Example 4
Source File: MustBeValidCommand.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanOperationInfo[] makeOpInfos(String[][] spec) {
    final MBeanOperationInfo[] result =
        new MBeanOperationInfo[spec.length];
    final MBeanParameterInfo[] pars = makeParInfos(parameters);
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanOperationInfo: " +
                           spec[i][0]);
        final MBeanOperationInfo item =
            new MBeanOperationInfo(spec[i][2],spec[i][0],pars,spec[i][1],
                                   MBeanOperationInfo.ACTION_INFO);
        result[i]=item;
    }
    return result;
}
 
Example 5
Source File: MemberInfoWithStatsMBean.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * Returns operations defined for this MBean as an array of 
 * MBeanOperationInfo objects.
 * 
 * @return operations defined as an array of MBeanOperationInfo objects. 
 */
@Override
protected MBeanOperationInfo[] createMBeanOperationInfo() {
  MBeanOperationInfo[] operationsInfo = new MBeanOperationInfo[MAX_OPERATIONS_COUNT];
  
  operationsInfo[0] = new MBeanOperationInfo("getMembers", 
                                             "Returns ids as strings for all the members - Application Peers & Cache Servers.", 
                                             new MBeanParameterInfo[] {}, 
                                             String[].class.getName(), 
                                             MBeanOperationInfo.ACTION_INFO);
  
  MBeanParameterInfo[] getMemberDetailsArgs = new MBeanParameterInfo[1];
  getMemberDetailsArgs[0] = new MBeanParameterInfo("memberId", String.class.getName(), "Id of the member for all the details are to be retrieved.");
  operationsInfo[1] = new MBeanOperationInfo("getMemberDetails", 
                                              "Returns details for a given member", 
                                              getMemberDetailsArgs, 
                                              Map.class.getName(), 
                                              MBeanOperationInfo.ACTION_INFO);
  
  /* For retrieving ObjectNames of existing Region MBeans, MBeanServerConnection.queryMBeans(), could be called */
  MBeanParameterInfo[] getRegionSnapArgs = new MBeanParameterInfo[1];
  getRegionSnapArgs[0] = new MBeanParameterInfo("memberId", String.class.getName(), "Id of the member on which we want to discover all the region MBean.");
  operationsInfo[2] = new MBeanOperationInfo("getRegions", 
                                              "Returns a java.util.Map of details of regions on a member", 
                                              getRegionSnapArgs, 
                                              Map.class.getName(), 
                                              MBeanOperationInfo.ACTION_INFO);

  
  return operationsInfo;
}
 
Example 6
Source File: MustBeValidCommand.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanOperationInfo[] makeOpInfos(String[][] spec) {
    final MBeanOperationInfo[] result =
        new MBeanOperationInfo[spec.length];
    final MBeanParameterInfo[] pars = makeParInfos(parameters);
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanOperationInfo: " +
                           spec[i][0]);
        final MBeanOperationInfo item =
            new MBeanOperationInfo(spec[i][2],spec[i][0],pars,spec[i][1],
                                   MBeanOperationInfo.ACTION_INFO);
        result[i]=item;
    }
    return result;
}
 
Example 7
Source File: MustBeValidCommand.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanOperationInfo[] makeOpInfos(String[][] spec) {
    final MBeanOperationInfo[] result =
        new MBeanOperationInfo[spec.length];
    final MBeanParameterInfo[] pars = makeParInfos(parameters);
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanOperationInfo: " +
                           spec[i][0]);
        final MBeanOperationInfo item =
            new MBeanOperationInfo(spec[i][2],spec[i][0],pars,spec[i][1],
                                   MBeanOperationInfo.ACTION_INFO);
        result[i]=item;
    }
    return result;
}
 
Example 8
Source File: MemberInfoWithStatsMBean.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * Returns operations defined for this MBean as an array of 
 * MBeanOperationInfo objects.
 * 
 * @return operations defined as an array of MBeanOperationInfo objects. 
 */
@Override
protected MBeanOperationInfo[] createMBeanOperationInfo() {
  MBeanOperationInfo[] operationsInfo = new MBeanOperationInfo[MAX_OPERATIONS_COUNT];
  
  operationsInfo[0] = new MBeanOperationInfo("getMembers", 
                                             "Returns ids as strings for all the members - Application Peers & Cache Servers.", 
                                             new MBeanParameterInfo[] {}, 
                                             String[].class.getName(), 
                                             MBeanOperationInfo.ACTION_INFO);
  
  MBeanParameterInfo[] getMemberDetailsArgs = new MBeanParameterInfo[1];
  getMemberDetailsArgs[0] = new MBeanParameterInfo("memberId", String.class.getName(), "Id of the member for all the details are to be retrieved.");
  operationsInfo[1] = new MBeanOperationInfo("getMemberDetails", 
                                              "Returns details for a given member", 
                                              getMemberDetailsArgs, 
                                              Map.class.getName(), 
                                              MBeanOperationInfo.ACTION_INFO);
  
  /* For retrieving ObjectNames of existing Region MBeans, MBeanServerConnection.queryMBeans(), could be called */
  MBeanParameterInfo[] getRegionSnapArgs = new MBeanParameterInfo[1];
  getRegionSnapArgs[0] = new MBeanParameterInfo("memberId", String.class.getName(), "Id of the member on which we want to discover all the region MBean.");
  operationsInfo[2] = new MBeanOperationInfo("getRegions", 
                                              "Returns a java.util.Map of details of regions on a member", 
                                              getRegionSnapArgs, 
                                              Map.class.getName(), 
                                              MBeanOperationInfo.ACTION_INFO);

  
  return operationsInfo;
}
 
Example 9
Source File: MustBeValidCommand.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanOperationInfo[] makeOpInfos(String[][] spec) {
    final MBeanOperationInfo[] result =
        new MBeanOperationInfo[spec.length];
    final MBeanParameterInfo[] pars = makeParInfos(parameters);
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanOperationInfo: " +
                           spec[i][0]);
        final MBeanOperationInfo item =
            new MBeanOperationInfo(spec[i][2],spec[i][0],pars,spec[i][1],
                                   MBeanOperationInfo.ACTION_INFO);
        result[i]=item;
    }
    return result;
}
 
Example 10
Source File: MustBeValidCommand.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanOperationInfo[] makeOpInfos(String[][] spec) {
    final MBeanOperationInfo[] result =
        new MBeanOperationInfo[spec.length];
    final MBeanParameterInfo[] pars = makeParInfos(parameters);
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanOperationInfo: " +
                           spec[i][0]);
        final MBeanOperationInfo item =
            new MBeanOperationInfo(spec[i][2],spec[i][0],pars,spec[i][1],
                                   MBeanOperationInfo.ACTION_INFO);
        result[i]=item;
    }
    return result;
}
 
Example 11
Source File: MustBeValidCommand.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanOperationInfo[] makeOpInfos(String[][] spec) {
    final MBeanOperationInfo[] result =
        new MBeanOperationInfo[spec.length];
    final MBeanParameterInfo[] pars = makeParInfos(parameters);
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanOperationInfo: " +
                           spec[i][0]);
        final MBeanOperationInfo item =
            new MBeanOperationInfo(spec[i][2],spec[i][0],pars,spec[i][1],
                                   MBeanOperationInfo.ACTION_INFO);
        result[i]=item;
    }
    return result;
}
 
Example 12
Source File: MustBeValidCommand.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanOperationInfo[] makeOpInfos(String[][] spec) {
    final MBeanOperationInfo[] result =
        new MBeanOperationInfo[spec.length];
    final MBeanParameterInfo[] pars = makeParInfos(parameters);
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanOperationInfo: " +
                           spec[i][0]);
        final MBeanOperationInfo item =
            new MBeanOperationInfo(spec[i][2],spec[i][0],pars,spec[i][1],
                                   MBeanOperationInfo.ACTION_INFO);
        result[i]=item;
    }
    return result;
}
 
Example 13
Source File: MustBeValidCommand.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanOperationInfo[] makeOpInfos(String[][] spec) {
    final MBeanOperationInfo[] result =
        new MBeanOperationInfo[spec.length];
    final MBeanParameterInfo[] pars = makeParInfos(parameters);
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanOperationInfo: " +
                           spec[i][0]);
        final MBeanOperationInfo item =
            new MBeanOperationInfo(spec[i][2],spec[i][0],pars,spec[i][1],
                                   MBeanOperationInfo.ACTION_INFO);
        result[i]=item;
    }
    return result;
}
 
Example 14
Source File: MustBeValidCommand.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanOperationInfo[] makeOpInfos(String[][] spec) {
    final MBeanOperationInfo[] result =
        new MBeanOperationInfo[spec.length];
    final MBeanParameterInfo[] pars = makeParInfos(parameters);
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanOperationInfo: " +
                           spec[i][0]);
        final MBeanOperationInfo item =
            new MBeanOperationInfo(spec[i][2],spec[i][0],pars,spec[i][1],
                                   MBeanOperationInfo.ACTION_INFO);
        result[i]=item;
    }
    return result;
}
 
Example 15
Source File: MustBeValidCommand.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanOperationInfo[] makeOpInfos(String[][] spec) {
    final MBeanOperationInfo[] result =
        new MBeanOperationInfo[spec.length];
    final MBeanParameterInfo[] pars = makeParInfos(parameters);
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanOperationInfo: " +
                           spec[i][0]);
        final MBeanOperationInfo item =
            new MBeanOperationInfo(spec[i][2],spec[i][0],pars,spec[i][1],
                                   MBeanOperationInfo.ACTION_INFO);
        result[i]=item;
    }
    return result;
}
 
Example 16
Source File: MustBeValidCommand.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanOperationInfo[] makeOpInfos(String[][] spec) {
    final MBeanOperationInfo[] result =
        new MBeanOperationInfo[spec.length];
    final MBeanParameterInfo[] pars = makeParInfos(parameters);
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanOperationInfo: " +
                           spec[i][0]);
        final MBeanOperationInfo item =
            new MBeanOperationInfo(spec[i][2],spec[i][0],pars,spec[i][1],
                                   MBeanOperationInfo.ACTION_INFO);
        result[i]=item;
    }
    return result;
}
 
Example 17
Source File: MBeanInfoRenderer.java    From text-ui with GNU General Public License v3.0 4 votes vote down vote up
@Override
public LineRenderer renderer(Iterator<MBeanInfo> stream) {

  List<LineRenderer> renderers = new ArrayList<LineRenderer>();

  while (stream.hasNext()) {
    MBeanInfo info = stream.next();

    //
    TreeElement root = new TreeElement(info.getClassName());

    // Descriptor
    TableElement descriptor = new TableElement().
        overflow(Overflow.HIDDEN).
        rightCellPadding(1);
    Descriptor descriptorInfo = info.getDescriptor();
    if (descriptorInfo != null) {
      for (String fieldName : descriptorInfo.getFieldNames()) {
        String fieldValue = String.valueOf(descriptorInfo.getFieldValue(fieldName));
        descriptor.row(fieldName, fieldValue);
      }
    }

    // Attributes
    TableElement attributes = new TableElement().
        overflow(Overflow.HIDDEN).
        rightCellPadding(1).
        add(new RowElement().style(Decoration.bold.fg(Color.black).bg(Color.white)).add("NAME", "TYPE", "DESCRIPTION"));
    for (MBeanAttributeInfo attributeInfo : info.getAttributes()) {
      attributes.row(attributeInfo.getName(), attributeInfo.getType(), attributeInfo.getDescription());
    }

    // Operations
    TreeElement operations = new TreeElement("Operations");
    for (MBeanOperationInfo operationInfo : info.getOperations()) {
      TableElement signature = new TableElement().
          overflow(Overflow.HIDDEN).
          rightCellPadding(1);
      MBeanParameterInfo[] parameterInfos = operationInfo.getSignature();
      for (MBeanParameterInfo parameterInfo : parameterInfos) {
        signature.row(parameterInfo.getName(), parameterInfo.getType(), parameterInfo.getDescription());
      }
      TreeElement operation = new TreeElement(operationInfo.getName());
      String impact;
      switch (operationInfo.getImpact()) {
        case MBeanOperationInfo.ACTION:
          impact = "ACTION";
          break;
        case MBeanOperationInfo.INFO:
          impact = "INFO";
          break;
        case MBeanOperationInfo.ACTION_INFO:
          impact = "ACTION_INFO";
          break;
        default:
          impact = "UNKNOWN";
      }
      operation.addChild(new TableElement().
          add(
              new RowElement().add("Type: ", operationInfo.getReturnType()),
              new RowElement().add("Description: ", operationInfo.getDescription()),
              new RowElement().add("Impact: ", impact),
              new RowElement().add(new LabelElement("Signature: "), signature)
          )
      );

      operations.addChild(operation);
    }

    //
    root.addChild(
      new TableElement().leftCellPadding(1).overflow(Overflow.HIDDEN).
        row("ClassName", info.getClassName()).
        row("Description", info.getDescription()
      )
    );
    root.addChild(new TreeElement("Descriptor").addChild(descriptor));
    root.addChild(new TreeElement("Attributes").addChild(attributes));
    root.addChild(operations);

    //
    renderers.add(root.renderer());
  }




  return LineRenderer.vertical(renderers);
}