Package javax.management.modelmbean

Examples of javax.management.modelmbean.RequiredModelMBean


  
   public void testRMMSetManagedResource()
   {
      try
      {
         ModelMBean modelmbean = new RequiredModelMBean();
         Resource resource = new Resource();
         modelmbean.setManagedResource(resource, "ObjectReference");
      }
      catch (Throwable t)
      {
         log.debug("failed", t);
         fail("Setting resource object with 'ObjectReference' type failed: " + t.toString());
View Full Code Here


  
   public void testRMMSetModelMBeanInfo()
   {
      try
      {
         ModelMBean modelmbean = new RequiredModelMBean();
         modelmbean.setModelMBeanInfo(getModelMBeanInfo());
      }
      catch (Throwable t)
      {
         log.debug("failed", t);
         fail("Unable to set model mbean info for resource object: " + t.toString());
View Full Code Here

      try
      {
         MBeanServer server = MBeanServerFactory.createMBeanServer();
        
         Resource resource = new Resource();
         ModelMBean modelmbean = new RequiredModelMBean();
         modelmbean.setModelMBeanInfo(getModelMBeanInfo());
         modelmbean.setManagedResource(resource, "ObjectReference");
        
         ObjectName name = new ObjectName("rmm:invocationTest=true");
         server.registerMBean(modelmbean, name);
        
         assertTrue(((Boolean)server.invoke(name, "isActive", new Object[] {}, new String[] {})).booleanValue());
View Full Code Here

      try
      {
         MBeanServer server = MBeanServerFactory.createMBeanServer();
        
         Resource2 resource = new Resource2();
         ModelMBean modelmbean = new RequiredModelMBean();
         modelmbean.setModelMBeanInfo(getModelMBeanInfo2());
         modelmbean.setManagedResource(resource, "ObjectReference");
        
         ObjectName name = new ObjectName("rmm:resourceImplementsMBean=true");
         server.registerMBean(modelmbean, name);
        
         server.setAttribute(name, new Attribute("pojoAttribute", new Integer(111)));
View Full Code Here

               null,                      // constructors
               null,                      // operations
               null                       // notification
         );

         ModelMBean mmb = new RequiredModelMBean();
         mmb.setManagedResource(new Resource(), OBJECT_REF);
         mmb.setModelMBeanInfo(info);

         ObjectName oname = new ObjectName("test:name=OnTimerCallBack");
         server.registerMBean(mmb, oname);

         Thread.sleep(5000);
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) {
                throw new JMException(itotex.getMessage());
            }
            registerMBeanWithServer(mbean, name, forceRegistration);
        }
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 = assembler.getMBeanInfo(obj, name.toString());
            RequiredModelMBean mbean = (RequiredModelMBean) mbeanServer.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

   * 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

        } 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) {
                throw new JMException(itotex.getMessage());
            }
            registerMBeanWithServer(mbean, name, forceRegistration);
        }
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.