Package javax.management.modelmbean

Examples of javax.management.modelmbean.RequiredModelMBean


            if (meFilter.isCreateEvent(event)) {
                   
                ModelMBeanInfo mbi = mbAssembler.getModelMbeanInfo(instrumentation.getClass());
               
                if (mbi != null) {                   
                    RequiredModelMBean rtMBean;
                    try {
                                               
                        rtMBean = (RequiredModelMBean)mbs.instantiate(
                            "javax.management.modelmbean.RequiredModelMBean");
                                      
                        rtMBean.setModelMBeanInfo(mbi);
                       
                        rtMBean.setManagedResource(instrumentation, "ObjectReference");
                                              
                        registerMBean(rtMBean,
                            JMXUtils.getObjectName(instrumentation.getInstrumentationName(),
                                                   instrumentation.getUniqueInstrumentationName(),
                                                   busID));
View Full Code Here


      
       
        //create the mbean and register it
        ModelMBeanInfo mbi = getMBeanInfoFromAssembler();
       
        RequiredModelMBean rtMBean;
       
        rtMBean = (RequiredModelMBean)server.instantiate(
            "javax.management.modelmbean.RequiredModelMBean");
                      
        rtMBean.setModelMBeanInfo(mbi);
   
        rtMBean.setManagedResource(ati, "ObjectReference");
                          
        server.registerMBean(rtMBean, ton);
    }
View Full Code Here

     * @param o The object to create an MBean for
     * @return The ModelMBean for the given object
     */
    public static ModelMBean createModelMBean(Object o) {
        try {
            ModelMBean mbean = new RequiredModelMBean();
            JmxManaged annotation = o.getClass().getAnnotation(JmxManaged.class);
            String description = annotation == null ? "" : annotation.description();
            ModelMBeanInfo info = new ModelMBeanInfoSupport(o.getClass().getName(),
                                                            description,
                                                            extractAttributeInfo(o),
                                                            new ModelMBeanConstructorInfo[0],
                                                            extractOperationInfo(o),
                                                            new ModelMBeanNotificationInfo[0]);
            mbean.setModelMBeanInfo(info);
            mbean.setManagedResource(o, "ObjectReference");

            return mbean;
        } catch(MBeanException e) {
            throw new VoldemortException(e);
        } catch(InvalidTargetObjectTypeException e) {
View Full Code Here

      } catch (NullPointerException e) {
        logger.error(e.getMessage(), e);
        return false;
      }

      RequiredModelMBean modelMbean = createModlerMBean(obj);
      try {
        return (server.registerMBean(modelMbean, objectname) != null);
      } catch (InstanceAlreadyExistsException e) {
        logger.warn(e.getMessage(), e);
View Full Code Here

      } catch (NullPointerException e) {
        logger.error(e.getMessage(), e);
        return false;
      }

      RequiredModelMBean modelMbean = createModlerMBean(obj);
      try {
        return (server.registerMBean(modelMbean, objectname) != null);
      } catch (InstanceAlreadyExistsException e) {
        logger.error(e.getMessage(), e);
      } catch (MBeanRegistrationException e) {
View Full Code Here

    return false;

  }

  private static RequiredModelMBean createModlerMBean(Object obj) {
    RequiredModelMBean model = null;
    try {
      model = new RequiredModelMBean();
      model.setManagedResource(obj, "ObjectReference");
      ModelMBeanInfo info = createModelMBeanInfo(obj);
      model.setModelMBeanInfo(info);
    } catch (Exception e) {
      logger.error(e.getMessage(), e);
    }
    return model;
  }
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
          ModelMBeanInfo mbi = null;
          mbi = assembler.getMBeanInfo(obj, name.toString());
            RequiredModelMBean mbean = (RequiredModelMBean)server.instantiate(RequiredModelMBean.class.getName());
            mbean.setModelMBeanInfo(mbi);
            try {
              mbean.setManagedResource(obj, "ObjectReference");
            } catch (InvalidTargetObjectTypeException itotex) {
                throw new JMException(itotex.getMessage());
            }
            registerMBeanWithServer(mbean, name, forceRegistration);
        }               
View Full Code Here

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

            // use the default provided mbean which has been annotated with JMX annotations
            log.trace("Assembling MBeanInfo for: {} from @ManagedResource object: {}", name, obj);
            mbi = assembler.getMBeanInfo(obj, null, name.toString());
        }

        RequiredModelMBean mbean = (RequiredModelMBean) mBeanServer.instantiate(RequiredModelMBean.class.getName());
        mbean.setModelMBeanInfo(mbi);

        try {
            mbean.setManagedResource(obj, "ObjectReference");
        } catch (InvalidTargetObjectTypeException e) {
            throw new JMException(e.getMessage());
        }
       
        // Allows the managed object to send notifications
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
            ModelMBeanInfo mbi;
            mbi = assembler.getMBeanInfo(obj, name.toString());
            RequiredModelMBean mbean = (RequiredModelMBean)server.instantiate(RequiredModelMBean.class.getName());
            mbean.setModelMBeanInfo(mbi);
            try {
                mbean.setManagedResource(obj, "ObjectReference");
            } catch (InvalidTargetObjectTypeException itotex) {
                throw new JMException(itotex.getMessage());
            }
            registerMBeanWithServer(mbean, name, forceRegistration);
        }
View Full Code Here

TOP

Related Classes of javax.management.modelmbean.RequiredModelMBean

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.