Package javax.management

Examples of javax.management.Descriptor


                Method setter = setters.get(name);
                ModelMBeanAttributeInfo info = new ModelMBeanAttributeInfo(name,
                                                                           descriptions.get(name),
                                                                           getter,
                                                                           setter);
                Descriptor descriptor = info.getDescriptor();
                if(getter != null)
                    descriptor.setField("getMethod", getter.getName());
                if(setter != null)
                    descriptor.setField("setMethod", setter.getName());
                info.setDescriptor(descriptor);
                infos.add(info);
            } catch(IntrospectionException e) {
                throw new VoldemortException(e);
            }
View Full Code Here


         default:
            throw new AssertionError();
      }

      //
      Descriptor operationDescriptor = operationInfo.getDescriptor();
      operationDescriptor.setField("role", role.name);

      //
      return new ModelMBeanOperationInfo(operationInfo.getName(), description, parameterInfos, operationInfo
         .getReturnType(), jmxImpact, operationDescriptor);
   }
View Full Code Here

            //
            ModelMBeanAttributeInfo attributeInfo =
               new ModelMBeanAttributeInfo(propertyMD.getName(), attributeDescription, getter, setter);

            //
            Descriptor attributeDescriptor = attributeInfo.getDescriptor();
            if (getter != null)
            {
               attributeDescriptor.setField("getMethod", getter.getName());
            }
            if (setter != null)
            {
               attributeDescriptor.setField("setMethod", setter.getName());
            }
            attributeDescriptor.setField("currencyTimeLimit", "-1");
            attributeDescriptor.setField("persistPolicy", "Never");
            attributeInfo.setDescriptor(attributeDescriptor);

            //
            ModelMBeanAttributeInfo previous = attributeInfos.put(propertyMD.getName(), attributeInfo);
            if (previous != null)
View Full Code Here

         default:
            throw new AssertionError();
      }

      //
      Descriptor operationDescriptor = operationInfo.getDescriptor();
      operationDescriptor.setField("role", role.name);

      //
      return new ModelMBeanOperationInfo(operationInfo.getName(), description, parameterInfos, operationInfo
         .getReturnType(), jmxImpact, operationDescriptor);
   }
View Full Code Here

            //
            ModelMBeanAttributeInfo attributeInfo =
               new ModelMBeanAttributeInfo(propertyMD.getName(), attributeDescription, getter, setter);

            //
            Descriptor attributeDescriptor = attributeInfo.getDescriptor();
            if (getter != null)
            {
               attributeDescriptor.setField("getMethod", getter.getName());
            }
            if (setter != null)
            {
               attributeDescriptor.setField("setMethod", setter.getName());
            }
            attributeDescriptor.setField("currencyTimeLimit", "-1");
            attributeDescriptor.setField("persistPolicy", "Never");
            attributeInfo.setDescriptor(attributeDescriptor);

            //
            ModelMBeanAttributeInfo previous = attributeInfos.put(propertyMD.getName(), attributeInfo);
            if (previous != null)
View Full Code Here

      {
         annotation = metaData.getAnnotation(annotationType);
         if(annotation == null && info instanceof DescriptorAccess)
         {
            DescriptorAccess daccess = (DescriptorAccess) info;
            Descriptor descriptor = daccess.getDescriptor();
            annotation = getAnnotation(annotationType, descriptor);
         }
      }
      return annotation;
   }
View Full Code Here

      // based on jmx book
      if (metadata == null)
      {
         return;
      }
      Descriptor d = ((ModelMBeanInfo)metadata).getMBeanDescriptor();
      String dir = (String)d.getFieldValue(ModelMBeanConstants.PERSIST_LOCATION);
      String file = (String)d.getFieldValue(ModelMBeanConstants.PERSIST_NAME);
      if (file == null)
      {
         return;
      }
      try
View Full Code Here

         return;
      }
      // based on jmx book
      try
      {
         Descriptor d = ((ModelMBeanInfo)metadata).getMBeanDescriptor();
         String dirPath = (String)d.getFieldValue(ModelMBeanConstants.PERSIST_LOCATION);
         String file = (String)d.getFieldValue(ModelMBeanConstants.PERSIST_NAME);
         File dir = new File(dirPath);
         dir.mkdirs();
         File f = new File(dir, file);
         store(metadata, f);
      }
View Full Code Here

      MBeanAttributeInfo[] attrs = metadata.getAttributes();
      for (int i = 0; i < attrs.length; i++)
      {
         /// for each attribute, create a new Attribute object and add it to the collection
         ModelMBeanAttributeInfo attributeInfo = (ModelMBeanAttributeInfo)attrs[i];
         Descriptor attrDesc = attributeInfo.getDescriptor();
         Object name = attrDesc.getFieldValue(ModelMBeanConstants.NAME);
         Object value = attrDesc.getFieldValue(ModelMBeanConstants.VALUE);
         logger().debug("creating attribute.  name: " + name + ", value: " + value);
         Attribute curAttribute = new Attribute(name.toString(), value);
         attributes.add(curAttribute);
      }
      setIsLoading(true);
View Full Code Here

   public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
   {
      // initialize MBeanInfo first
      // add the resource classname to the MBean info
      ModelMBeanInfoSupport infoSupport = (ModelMBeanInfoSupport) info;
      Descriptor mbeanDescriptor = infoSupport.getMBeanDescriptor();
      mbeanDescriptor.setField(
        ModelMBeanConstants.RESOURCE_CLASS,
        getResource().getClass().getName());
      // make sure we call super to ensure the MBeanInvoker is initialized
      // before continuing
      super.preRegister(server, name);
View Full Code Here

TOP

Related Classes of javax.management.Descriptor

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.