Package javax.management.modelmbean

Examples of javax.management.modelmbean.RequiredModelMBean


            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


      
       
        //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

        }
    }
   
    private void register(Object obj, ObjectName name, ModelMBeanInfo mbi, boolean forceRegistration)
        throws JMException {                 
        RequiredModelMBean rtMBean =
            (RequiredModelMBean)mbs.instantiate("javax.management.modelmbean.RequiredModelMBean");
        rtMBean.setModelMBeanInfo(mbi);
        try {
            rtMBean.setManagedResource(obj, "ObjectReference");
        } catch (InvalidTargetObjectTypeException itotex) {
            throw new JMException(itotex.getMessage());
        }
        registerMBeanWithServer(rtMBean, name, forceRegistration);
    }
View Full Code Here

     */
    public void registerMBean(Instrumentation instrumentation) {
        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()));
                                      
View Full Code Here

        }
    }
   
    private void register(Object obj, ObjectName name, ModelMBeanInfo mbi, boolean forceRegistration)
        throws JMException {                 
        RequiredModelMBean rtMBean =
            (RequiredModelMBean)mbs.instantiate("javax.management.modelmbean.RequiredModelMBean");
        rtMBean.setModelMBeanInfo(mbi);
        try {
            rtMBean.setManagedResource(obj, "ObjectReference");
        } catch (InvalidTargetObjectTypeException itotex) {
            throw new JMException(itotex.getMessage());
        }
        registerMBeanWithServer(rtMBean, name, forceRegistration);
    }
View Full Code Here

        }
    }
   
    private void register(Object obj, ObjectName name, ModelMBeanInfo mbi, boolean forceRegistration)
        throws JMException {                 
        RequiredModelMBean rtMBean =
            (RequiredModelMBean)mbs.instantiate("javax.management.modelmbean.RequiredModelMBean");
        rtMBean.setModelMBeanInfo(mbi);
        try {
            rtMBean.setManagedResource(obj, "ObjectReference");
        } catch (InvalidTargetObjectTypeException itotex) {
            throw new JMException(itotex.getMessage());
        }
        registerMBeanWithServer(rtMBean, persist(name), forceRegistration);
    }
View Full Code Here

        this.shutdown();
    }
   
    private void register(Object obj, ObjectName name, ModelMBeanInfo mbi, boolean forceRegistration)
        throws JMException {                 
        RequiredModelMBean rtMBean =
            (RequiredModelMBean)mbs.instantiate("javax.management.modelmbean.RequiredModelMBean");
        rtMBean.setModelMBeanInfo(mbi);
        try {
            rtMBean.setManagedResource(obj, "ObjectReference");
        } catch (InvalidTargetObjectTypeException itotex) {
            throw new JMException(itotex.getMessage());
        }
        registerMBeanWithServer(rtMBean, persist(name), forceRegistration);
    }
View Full Code Here

        this.shutdown();
    }
   
    private void register(Object obj, ObjectName name, ModelMBeanInfo mbi, boolean forceRegistration)
        throws JMException {                 
        RequiredModelMBean rtMBean =
            (RequiredModelMBean)mbs.instantiate("javax.management.modelmbean.RequiredModelMBean");
        rtMBean.setModelMBeanInfo(mbi);
        try {
            rtMBean.setManagedResource(obj, "ObjectReference");
        } catch (InvalidTargetObjectTypeException itotex) {
            throw new JMException(itotex.getMessage());
        }
        registerMBeanWithServer(rtMBean, persist(name), forceRegistration);
    }
View Full Code Here

  @Test
  public void testRegisterExistingMBeanWithUserSuppliedObjectName() throws Exception {
    ObjectName objectName = ObjectNameManager.getInstance("spring:name=Foo");
    ModelMBeanInfo info = new ModelMBeanInfoSupport("myClass", "myDescription", null, null, null, null);
    RequiredModelMBean bean = new RequiredModelMBean(info);

    MBeanExporter exporter = new MBeanExporter();
    exporter.setServer(getServer());
    exporter.registerManagedResource(bean, objectName);
View Full Code Here

   * registration phase and must return a new instance of {@code ModelMBean}
   * @return a new instance of a class that implements {@code ModelMBean}
   * @throws javax.management.MBeanException if creation of the ModelMBean failed
   */
  protected ModelMBean createModelMBean() throws MBeanException {
    return (this.exposeManagedResourceClassLoader ? new SpringModelMBean() : new RequiredModelMBean());
  }
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.