Package javax.management.modelmbean

Examples of javax.management.modelmbean.ModelMBeanInfo


               !IS_WRITABLE,
               !IS_IS,
               descriptor
         );

         ModelMBeanInfo info = new ModelMBeanInfoSupport(
               Resource.class.getName(),
               "Test Resource",
               new ModelMBeanAttributeInfo[] { attrInfo },
               null,                      // constructors
               null,                      // operations
View Full Code Here


        try {
            registerMBeanWithServer(obj, name, forceRegistration);
        } catch (NotCompliantMBeanException e) {
            // If this is not a "normal" MBean, then try to deploy it using JMX annotations
            LOG.info("It's not a normal MBean");
            ModelMBeanInfo mbi = assembler.getMBeanInfo(obj, name.toString());
            RequiredModelMBean mbean = (RequiredModelMBean) mbeanServer.instantiate(RequiredModelMBean.class.getName());
            mbean.setModelMBeanInfo(mbi);
            try {
                mbean.setManagedResource(obj, "ObjectReference");
            } catch (InvalidTargetObjectTypeException itotex) {
View Full Code Here

        try {
            registerMBeanWithServer(obj, name, forceRegistration);
        } catch (NotCompliantMBeanException e) {
            // If this is not a "normal" MBean, then try to deploy it using JMX
            // annotations
            ModelMBeanInfo mbi = assembler.getMBeanInfo(obj, name.toString());
            RequiredModelMBean mbean = (RequiredModelMBean) mbeanServer.instantiate(RequiredModelMBean.class.getName());
            mbean.setModelMBeanInfo(mbi);
            try {
                mbean.setManagedResource(obj, "ObjectReference");
            } catch (InvalidTargetObjectTypeException itotex) {
View Full Code Here

  /**
   * Gets the <code>ModelMBeanInfo</code> for the bean with the supplied key
   * and of the supplied type.
   */
  private ModelMBeanInfo getMBeanInfo(Object managedBean, String beanKey) throws JMException {
    ModelMBeanInfo info = this.assembler.getMBeanInfo(managedBean, beanKey);
    if (logger.isWarnEnabled() && ObjectUtils.isEmpty(info.getAttributes()) &&
        ObjectUtils.isEmpty(info.getOperations())) {
      logger.warn("Bean with key '" + beanKey +
          "' has been registered as an MBean but has no exposed attributes or operations");
    }
    return info;
  }
View Full Code Here

            registerMBeanWithServer(obj, name, forceRegistration);
        } catch (NotCompliantMBeanException e) {
            // If this is not a "normal" MBean, then try to deploy it using JMX
            // annotations
            LOG.info("It's not a normal MBean");
            ModelMBeanInfo mbi = assembler.getMBeanInfo(obj, name.toString());
            RequiredModelMBean mbean = (RequiredModelMBean) mbeanServer.instantiate(RequiredModelMBean.class.getName());
            mbean.setModelMBeanInfo(mbi);
            try {
                mbean.setManagedResource(obj, "ObjectReference");
            } catch (InvalidTargetObjectTypeException itotex) {
View Full Code Here

    public void register(Object obj, ObjectName name, boolean forceRegistration) throws JMException {
        try {
            registerMBeanWithServer(obj, name, forceRegistration);
        } catch (NotCompliantMBeanException e) {
            // If this is not a "normal" MBean, then try to deploy it using JMX annotations
            ModelMBeanInfo mbi;
            mbi = assembler.getMBeanInfo(obj, name.toString());
            RequiredModelMBean mbean = (RequiredModelMBean)server.instantiate(RequiredModelMBean.class.getName());
            mbean.setModelMBeanInfo(mbi);
            try {
                mbean.setManagedResource(obj, "ObjectReference");
View Full Code Here

   * @see #getNotificationInfo(Object, String)
   * @see #populateMBeanDescriptor(javax.management.Descriptor, Object, String)
   */
  public ModelMBeanInfo getMBeanInfo(Object managedBean, String beanKey) throws JMException {
    checkManagedBean(managedBean);
    ModelMBeanInfo info = new ModelMBeanInfoSupport(
        getClassName(managedBean, beanKey), getDescription(managedBean, beanKey),
        getAttributeInfo(managedBean, beanKey), getConstructorInfo(managedBean, beanKey),
        getOperationInfo(managedBean, beanKey), getNotificationInfo(managedBean, beanKey));
    Descriptor desc = info.getMBeanDescriptor();
    populateMBeanDescriptor(desc, managedBean, beanKey);
    info.setMBeanDescriptor(desc);
    return info;
  }
View Full Code Here

  /**
   * Gets the <code>ModelMBeanInfo</code> for the bean with the supplied key
   * and of the supplied type.
   */
  private ModelMBeanInfo getMBeanInfo(Object managedBean, String beanKey) throws JMException {
    ModelMBeanInfo info = this.assembler.getMBeanInfo(managedBean, beanKey);
    if (logger.isWarnEnabled() && ObjectUtils.isEmpty(info.getAttributes()) &&
        ObjectUtils.isEmpty(info.getOperations())) {
      logger.warn("Bean with key '" + beanKey +
          "' has been registered as an MBean but has no exposed attributes or operations");
    }
    return info;
  }
View Full Code Here

        this.assembler = new MetadataMBeanInfoAssembler();
        this.assembler.setAttributeSource(new AnnotationJmxAttributeSource());
    }

    public RequiredModelMBean assemble(Object obj, ObjectName name) throws JMException {
        ModelMBeanInfo mbi = null;

        // prefer to use the managed instance if it has been annotated with Spring JMX annotations
        if (obj instanceof ManagedInstance) {
            Object custom = ((ManagedInstance) obj).getInstance();
            if (custom != null && ObjectHelper.hasAnnotation(custom.getClass().getAnnotations(), ManagedResource.class)) {
View Full Code Here

  /**
   * Gets the <code>ModelMBeanInfo</code> for the bean with the supplied key
   * and of the supplied type.
   */
  private ModelMBeanInfo getMBeanInfo(Object managedBean, String beanKey) throws JMException {
    ModelMBeanInfo info = this.assembler.getMBeanInfo(managedBean, beanKey);
    if (logger.isWarnEnabled() && ObjectUtils.isEmpty(info.getAttributes()) &&
        ObjectUtils.isEmpty(info.getOperations())) {
      logger.warn("Bean with key '" + beanKey +
          "' has been registered as an MBean but has no exposed attributes or operations");
    }
    return info;
  }
View Full Code Here

TOP

Related Classes of javax.management.modelmbean.ModelMBeanInfo

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.