Package javax.management.modelmbean

Examples of javax.management.modelmbean.ModelMBeanOperationInfo


        addAttributes(attributes, source);
        addExtraAttributes(attributes);
       
        addOperations(operations, source);
        addExtraOperations(operations);
        operations.add(new ModelMBeanOperationInfo(
                "unregisterMBean", "unregisterMBean",
                new MBeanParameterInfo[0], void.class.getName(),
                ModelMBeanOperationInfo.ACTION));

        return new ModelMBeanInfoSupport(
View Full Code Here


   public ModelMBeanOperationInfo createModelMBeanOperationInfo()
   {
      String[] names = new String[]{"name", "descriptortype", "role", "displayname"/*, "lastReturnedTimeStamp"*/};
      Object[] values = new Object[]{"name", "operation", "operation", "name"/*, "0"*/};
      DescriptorSupport descriptor = new DescriptorSupport(names, values);
      return new ModelMBeanOperationInfo("name", "description", new MBeanParameterInfo[]{createMBeanParameterInfo()}, "java.lang.Object", MBeanOperationInfo.UNKNOWN, descriptor);
   }
View Full Code Here

            "ThirdConstructor",
            "Description of the 3rd constructor",
            null
      );
     
      ModelMBeanOperationInfo operation = new ModelMBeanOperationInfo(
            "AnOperation",
            "The description",
            null,
            "AType",
            MBeanOperationInfo.ACTION
View Full Code Here

            "ThirdConstructor",
            "Description of the 3rd constructor",
            null
      );
     
      ModelMBeanOperationInfo operation = new ModelMBeanOperationInfo(
            "AnOperation",
            "The description",
            null,
            "AType",
            MBeanOperationInfo.ACTION
View Full Code Here

            "ThirdConstructor",
            "Description of the 3rd constructor",
            null
      );
     
      ModelMBeanOperationInfo operation = new ModelMBeanOperationInfo(
            "AnOperation",
            "The description",
            null,
            "AType",
            MBeanOperationInfo.ACTION
View Full Code Here

      Descriptor descr3 = new DescriptorSupport();
      descr3.setField("name", "isActive");
      descr3.setField("descriptorType", "operation");
      descr3.setField("role", "getter");

      ModelMBeanOperationInfo isActiveInfo =
         new ModelMBeanOperationInfo(
            "isActive",                   // name & description
            "Checks if the printer is currently active.",
            null,                         // signature
            boolean.class.getName(),      // return type
            MBeanOperationInfo.INFO,      // impact
View Full Code Here

      Descriptor descr3 = new DescriptorSupport();
      descr3.setField("name", "isActive");
      descr3.setField("descriptorType", "operation");
      descr3.setField("role", "getter");

      ModelMBeanOperationInfo isActiveInfo =
         new ModelMBeanOperationInfo(
            "isActive",                   // name & description
            "Checks if the printer is currently active.",
            null,                         // signature
            boolean.class.getName(),      // return type
            MBeanOperationInfo.INFO,      // impact
View Full Code Here

      // build 'getpojoAttribute' operation
      Descriptor descr21 = new DescriptorSupport();
      descr21.setField("name", "getpojoAttribute");
      descr21.setField("descriptorType", "operation");
     
      ModelMBeanOperationInfo getpojoAttributeOperation =
         new ModelMBeanOperationInfo(
            "getpojoAttribute",           // name
            "A simple operation.",        // description
            null,                         // signature
            int.class.getName(),          // return type
            MBeanOperationInfo.INFO,      // impact
            descr21                       // descriptor
         );
     
      // build 'setpojoAttribute' operation
      Descriptor descr22 = new DescriptorSupport();
      descr22.setField("name", "setpojoAttribute");
      descr22.setField("descriptorType", "operation");
     
      ModelMBeanOperationInfo setpojoAttributeOperation =
         new ModelMBeanOperationInfo(
            "setpojoAttribute",           // name
            "A simple operation.",        // description
            new MBeanParameterInfo[]      // signature
                  { new MBeanParameterInfo("int", int.class.getName(), "int setter") },
            void.class.getName(),         // return type
            MBeanOperationInfo.ACTION,    // impact
            descr22                       // descriptor
         );
     
      // build 'pojoOperation' operation
      Descriptor descr3 = new DescriptorSupport();
      descr3.setField("name", "pojoOperation");
      descr3.setField("descriptorType", "operation");

      ModelMBeanOperationInfo pojoOperationInfo =
         new ModelMBeanOperationInfo(
            "pojoOperation",              // name & description
            "A simple operation.",
            null,                         // signature
            boolean.class.getName(),      // return type
            MBeanOperationInfo.ACTION,    // impact
View Full Code Here

      }
      if (method.getDeclaringClass().equals(Object.class)) {
        continue;
      }

      ModelMBeanOperationInfo info = null;
      PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
      if (pd != null) {
        if ((method.equals(pd.getReadMethod()) && includeReadAttribute(method, beanKey)) ||
            (method.equals(pd.getWriteMethod()) && includeWriteAttribute(method, beanKey))) {
          // Attributes need to have their methods exposed as
          // operations to the JMX server as well.
          info = createModelMBeanOperationInfo(method, pd.getName(), beanKey);
          Descriptor desc = info.getDescriptor();
          if (method.equals(pd.getReadMethod())) {
            desc.setField(FIELD_ROLE, ROLE_GETTER);
          }
          else {
            desc.setField(FIELD_ROLE, ROLE_SETTER);
          }
          desc.setField(FIELD_VISIBILITY, ATTRIBUTE_OPERATION_VISIBILITY);
          if (isExposeClassDescriptor()) {
            desc.setField(FIELD_CLASS, getClassForDescriptor(managedBean).getName());
          }
          info.setDescriptor(desc);
        }
      }

      // allow getters and setters to be marked as operations directly
      if (info == null && includeOperation(method, beanKey)) {
        info = createModelMBeanOperationInfo(method, method.getName(), beanKey);
        Descriptor desc = info.getDescriptor();
        desc.setField(FIELD_ROLE, ROLE_OPERATION);
        if (isExposeClassDescriptor()) {
          desc.setField(FIELD_CLASS, getClassForDescriptor(managedBean).getName());
        }
        populateOperationDescriptor(desc, method, beanKey);
        info.setDescriptor(desc);
      }

      if (info != null) {
        infos.add(info);
      }
View Full Code Here

   * @return the <code>ModelMBeanOperationInfo</code>
   */
  protected ModelMBeanOperationInfo createModelMBeanOperationInfo(Method method, String name, String beanKey) {
    MBeanParameterInfo[] params = getOperationParameters(method, beanKey);
    if (params.length == 0) {
      return new ModelMBeanOperationInfo(getOperationDescription(method, beanKey), method);
    }
    else {
      return new ModelMBeanOperationInfo(name,
        getOperationDescription(method, beanKey),
        getOperationParameters(method, beanKey),
        method.getReturnType().getName(),
        MBeanOperationInfo.UNKNOWN);
    }
View Full Code Here

TOP

Related Classes of javax.management.modelmbean.ModelMBeanOperationInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.