Package javax.management.modelmbean

Examples of javax.management.modelmbean.RequiredModelMBean


   * registration phase and must return a new instance of <code>ModelMBean</code>
   * @return a new instance of a class that implements <code>ModelMBean</code>
   * @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


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

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

        try {
            mbean.setManagedResource(obj, "ObjectReference");
        } catch (InvalidTargetObjectTypeException e) {
            throw new JMException(e.getMessage());
        }
       
        if (obj instanceof NotificationPublisherAware) {
View Full Code Here

   * registration phase and must return a new instance of <code>ModelMBean</code>
   * @return a new instance of a class that implements <code>ModelMBean</code>
   * @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

        try {
            if (mBeanInfo == null) {
                final Class managementInterface = getManagementInterface(componentInstance.getClass(), management, null);
                return new StandardMBean(componentInstance, managementInterface);
            } else if (mBeanInfo instanceof ModelMBeanInfo) {
                final ModelMBean mBean = new RequiredModelMBean((ModelMBeanInfo)mBeanInfo);
                try {
                    mBean.setManagedResource(componentInstance, "ObjectReference");
                } catch (final InvalidTargetObjectTypeException e) {
                    // N/A: "ObjectReference" is a valid reference type
                } catch (final InstanceNotFoundException e) {
                    // N/A: the instance was a valid object
                }
View Full Code Here

   * registration phase and must return a new instance of <code>ModelMBean</code>
   * @return a new instance of a class that implements <code>ModelMBean</code>
   * @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

        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

  }

  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

                LOG.trace("Assembling MBeanInfo for: " + name.toString() + " from @ManagedResource object: " + obj);
            }
            mbi = assembler.getMBeanInfo(obj, name.toString());
        }

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

        try {
            mbean.setManagedResource(obj, "ObjectReference");
        } catch (InvalidTargetObjectTypeException e) {
            throw new JMException(e.getMessage());
        }

        return mbean;
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

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.