Package javax.management

Examples of javax.management.MBeanInfo


   public MBeanInfo getMBeanInfo(MBeanMetaData metadata)
   {
      if (metadata.dynamic)
      {
         // From JMX 1.1 the MBeanInfo may be dynamically changed at every time, let's refresh it
     MBeanInfo info = null;
     try {
       info = ((DynamicMBean)metadata.mbean).getMBeanInfo();
     } catch (RuntimeException x) {
       throw new RuntimeMBeanException(x);
     }
         if (info == null) return null;
         metadata.info = info;

         // Refresh also ObjectInstance.getClassName(), if it's the case
         String className = info.getClassName();
         if (!metadata.instance.getClassName().equals(className))
         {
            metadata.instance = new ObjectInstance(metadata.name, className);
         }
      }
View Full Code Here


   public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException
   {
      if (attribute == null) throw new AttributeNotFoundException("Attribute " + attribute + " not found");

      Object resource = null;
      MBeanInfo info = null;
      synchronized (this)
      {
         resource = getResourceOrThis();
         info = getMBeanInfo();
      }

      MBeanAttributeInfo[] attrs = info.getAttributes();
      if (attrs == null || attrs.length == 0) throw new AttributeNotFoundException("No attributes defined for this MBean");

      for (int i = 0; i < attrs.length; ++i)
      {
         MBeanAttributeInfo attr = attrs[i];
View Full Code Here

      if (method == null) throw new IllegalArgumentException("Method name cannot be null");
      if (arguments == null) arguments = new Object[0];
      if (params == null) params = new String[0];

      Object resource = null;
      MBeanInfo info = null;
      synchronized (this)
      {
         resource = getResourceOrThis();
         info = getMBeanInfo();
      }

      MBeanOperationInfo[] opers = info.getOperations();
      if (opers == null || opers.length == 0) throw new ReflectionException(new NoSuchMethodException("No operations defined for this MBean"));

      for (int i = 0; i < opers.length; ++i)
      {
         MBeanOperationInfo oper = opers[i];
View Full Code Here

   public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
   {
      if (attribute == null) throw new AttributeNotFoundException("Attribute " + attribute + " not found");

      Object resource = null;
      MBeanInfo info = null;
      synchronized (this)
      {
         resource = getResourceOrThis();
         info = getMBeanInfo();
      }

      MBeanAttributeInfo[] attrs = info.getAttributes();
      if (attrs == null || attrs.length == 0) throw new AttributeNotFoundException("No attributes defined for this MBean");

      for (int i = 0; i < attrs.length; ++i)
      {
         MBeanAttributeInfo attr = attrs[i];
View Full Code Here

      MBeanConstructorInfo[] ctors = createMBeanConstructorInfo();
      MBeanOperationInfo[] opers = createMBeanOperationInfo();
      MBeanNotificationInfo[] notifs = createMBeanNotificationInfo();
      String className = getMBeanClassName();
      String description = getMBeanDescription();
      return new MBeanInfo(className, description, attrs, ctors, opers, notifs);
   }
View Full Code Here

      }

      if (oper != null) return oper;

      // The MBeanOperationInfo is not in the cache, look it up
      MBeanInfo info = metadata.info;
      MBeanOperationInfo[] opers = info.getOperations();
      if (opers != null)
      {
         for (int i = 0; i < opers.length; ++i)
         {
            oper = opers[i];
View Full Code Here

   {
      objectName = secureObjectName(objectName);

      MBeanMetaData metadata = findMBeanMetaData(objectName);

      MBeanInfo info = getHeadInterceptor().getMBeanInfo(metadata);
      if (info == null) throw new JMRuntimeException("MBeanInfo returned for MBean " + objectName + " is null");
      return info;
   }
View Full Code Here

      return document;
    }

    if (server.isRegistered(name))
    {
      MBeanInfo info = server.getMBeanInfo(name);
      MBeanOperationInfo[] operations = info.getOperations();
      boolean match = false;
      if (operations != null)
      {
        for (int j=0;j<operations.length;j++)
        {
View Full Code Here

        continue;
      }
      Element mBeanElement = document.createElement("MBean");
      mBeanElement.setAttribute("objectname", instance.getObjectName().toString());
      mBeanElement.setAttribute("classname", instance.getClassName());
      MBeanInfo info = server.getMBeanInfo(instance.getObjectName());
      mBeanElement.setAttribute("description", info.getDescription());
      root.appendChild(mBeanElement);
    }
    return document;
  }
View Full Code Here

        {
          continue;
        }
        Element mBeanElement = document.createElement("MBean");
        mBeanElement.setAttribute("objectname", targetName.toString());
        MBeanInfo info = server.getMBeanInfo(targetName);
        mBeanElement.setAttribute("description", info.getDescription());
        mBeanElement.setAttribute("classname", info.getClassName());
        domainElement.appendChild(mBeanElement);
      }
    }
    return document;
  }
View Full Code Here

TOP

Related Classes of javax.management.MBeanInfo

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.