Package javax.management.modelmbean

Examples of javax.management.modelmbean.RequiredModelMBean


   {
      final boolean READABLE = true;
      final boolean WRITABLE = true;
      final boolean ISIS     = true;
     
      RequiredModelMBean mbean = new RequiredModelMBean();
     
      ModelMBeanAttributeInfo attr1 = new ModelMBeanAttributeInfo(
            "Kissa",
            String.class.getName(),
            "Some attribute description",
            !READABLE, !WRITABLE, !ISIS
      );
     
      ModelMBeanAttributeInfo attr2 = new ModelMBeanAttributeInfo(
            "Koira",
            String.class.getName(),
            "Another attribute description",
            !READABLE, !WRITABLE, !ISIS
      );
     
      ModelMBeanConstructorInfo constr1 = new ModelMBeanConstructorInfo(
            "FirstConstructor",
            "Description of the first constructor",
            null
      );
     
      ModelMBeanConstructorInfo constr2 = new ModelMBeanConstructorInfo(
            "SecondConstructor",
            "Description of the second constructor",
            null
      );
     
      ModelMBeanConstructorInfo constr3 = new ModelMBeanConstructorInfo(
            "ThirdConstructor",
            "Description of the 3rd constructor",
            null
      );
     
      ModelMBeanOperationInfo operation = new ModelMBeanOperationInfo(
            "AnOperation",
            "The description",
            null,
            "AType",
            MBeanOperationInfo.ACTION
      );
     
      ModelMBeanInfoSupport info = new ModelMBeanInfoSupport(
            mbean.getClass().getName(),
            "some description",
            new ModelMBeanAttributeInfo[]    { attr1, attr2 },
            new ModelMBeanConstructorInfo[]  { constr1, constr2, constr3 },
            new ModelMBeanOperationInfo[]    { operation },
            null
View Full Code Here


   {
      final boolean READABLE = true;
      final boolean WRITABLE = true;
      final boolean ISIS     = true;
     
      RequiredModelMBean mbean = new RequiredModelMBean();
     
      ModelMBeanAttributeInfo attr1 = new ModelMBeanAttributeInfo(
            "Kissa",
            String.class.getName(),
            "Some attribute description",
            !READABLE, !WRITABLE, !ISIS
      );
     
      ModelMBeanAttributeInfo attr2 = new ModelMBeanAttributeInfo(
            "Koira",
            String.class.getName(),
            "Another attribute description",
            !READABLE, !WRITABLE, !ISIS
      );
     
      ModelMBeanConstructorInfo constr1 = new ModelMBeanConstructorInfo(
            "FirstConstructor",
            "Description of the first constructor",
            null
      );
     
      ModelMBeanConstructorInfo constr2 = new ModelMBeanConstructorInfo(
            "SecondConstructor",
            "Description of the second constructor",
            null
      );
     
      ModelMBeanConstructorInfo constr3 = new ModelMBeanConstructorInfo(
            "ThirdConstructor",
            "Description of the 3rd constructor",
            null
      );
     
      ModelMBeanOperationInfo operation = new ModelMBeanOperationInfo(
            "AnOperation",
            "The description",
            null,
            "AType",
            MBeanOperationInfo.ACTION
      );
     
      ModelMBeanInfoSupport info = new ModelMBeanInfoSupport(
            mbean.getClass().getName(),
            "some description",
            new ModelMBeanAttributeInfo[]    { attr1, attr2 },
            new ModelMBeanConstructorInfo[]  { constr1, constr2, constr3 },
            new ModelMBeanOperationInfo[]    { operation },
            null
View Full Code Here

   public void testRequiredModelMBeanConstructors()
   {
      try
      {
         new RequiredModelMBean();
      }
      catch (Throwable t)
      {
         t.printStackTrace();
         fail("Creating Required ModelMBean instance with default constructor failed: " + t.toString());
View Full Code Here

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

      throws Exception
   {
      MBeanServer server = MBeanServerFactory.createMBeanServer();
        
      Resource resource = new Resource();
      ModelMBean modelmbean = new RequiredModelMBean();
      modelmbean.setModelMBeanInfo(getModelMBeanInfo());
      
      ObjectName name = new ObjectName("rmm:invocationTest=true");
      server.registerMBean(modelmbean, name);

      modelmbean.setManagedResource(resource, "ObjectReference");

      MBeanInfo info = server.getMBeanInfo(name);
      assertTrue("MBeanInfo != null", info != null);

      Object[] args = {};
View Full Code Here

      throws Exception
   {
      MBeanServer server = MBeanServerFactory.createMBeanServer();
        
      Resource resource = new Resource();
      ModelMBean modelmbean = new RequiredModelMBean();
      modelmbean.setModelMBeanInfo(getModelMBeanInfo());
      
      ObjectName name = new ObjectName("rmm:invocationTest=true");
      server.registerMBean(modelmbean, name);

      Object[] args = {resource, "ObjectReference"};
View Full Code Here

   }

   public void testRMMSetModelMBeanInfo()
      throws Exception
   {
      ModelMBean modelmbean = new RequiredModelMBean();
      modelmbean.setModelMBeanInfo(getModelMBeanInfo());
   }
View Full Code Here

      throws Exception
   {
      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);

      MBeanInfo info = server.getMBeanInfo(name);
View Full Code Here

      throws Exception
   {
      MBeanServer server = MBeanServerFactory.newMBeanServer();
        
      Resource resource = new Resource();
      ModelMBean modelmbean = new RequiredModelMBean();
      modelmbean.setManagedResource(resource, "ObjectReference");
      modelmbean.setModelMBeanInfo(getModelMBeanInfo());
        
      ObjectName name = new ObjectName("rmm:test=default");
      server.registerMBean(modelmbean, name);
        
      assertTrue("Should be the default room", server.getAttribute(name, "Room").equals("D325"));
View Full Code Here

   public void testRequiredModelMBeanConstructors()
   {
      try
      {
         new RequiredModelMBean();
      }
      catch (Throwable t)
      {
         log.debug("failed", t);
         fail("Creating Required ModelMBean instance with default constructor failed: " + t.toString());
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.