Examples of MBeanConfigurationElement


Examples of org.jboss.test.messaging.tools.jboss.MBeanConfigurationElement

   }

   public ObjectName deploy(String mbeanConfiguration) throws Exception
   {
      Element mbeanElement = XMLUtil.stringToElement(mbeanConfiguration);
      MBeanConfigurationElement mbc = new MBeanConfigurationElement(mbeanElement);
      return sc.registerAndConfigureService(mbc);
   }
View Full Code Here

Examples of org.jboss.test.messaging.tools.jboss.MBeanConfigurationElement

         ServiceDeploymentDescriptor mdd =
            new ServiceDeploymentDescriptor(mainConfigFileURL);
         ServiceDeploymentDescriptor pdd =
            new ServiceDeploymentDescriptor(persistenceConfigFileURL);

         MBeanConfigurationElement persistenceManagerConfig =
            (MBeanConfigurationElement)pdd.query("service", "PersistenceManager").iterator().next();
         persistenceManagerObjectName = sc.registerAndConfigureService(persistenceManagerConfig);
         overrideAttributes(persistenceManagerObjectName, attrOverrides);
         sc.invoke(persistenceManagerObjectName, "create", new Object[0], new String[0]);
         sc.invoke(persistenceManagerObjectName, "start", new Object[0], new String[0]);

         MBeanConfigurationElement jmsUserManagerConfig =
            (MBeanConfigurationElement)pdd.query("service", "JMSUserManager").iterator().next();
         jmsUserManagerObjectName = sc.registerAndConfigureService(jmsUserManagerConfig);
         overrideAttributes(jmsUserManagerObjectName, attrOverrides);
         sc.invoke(jmsUserManagerObjectName, "create", new Object[0], new String[0]);
         sc.invoke(jmsUserManagerObjectName, "start", new Object[0], new String[0]);

         // register server peer as a service, dependencies are injected automatically
         MBeanConfigurationElement serverPeerConfig =
            (MBeanConfigurationElement)mdd.query("service", "ServerPeer").iterator().next();

         // overwrite the file configuration, if needed
         serverPeerConfig.setConstructorArgumentValue(0, 0, String.valueOf(serverPeerID));

         if (defaultQueueJNDIContext != null)
         {
            serverPeerConfig.setConstructorArgumentValue(0, 1, defaultQueueJNDIContext);
         }
        
         if (defaultTopicJNDIContext != null)
         {
            serverPeerConfig.setConstructorArgumentValue(0, 2, defaultTopicJNDIContext);
         }

         serverPeerObjectName = sc.registerAndConfigureService(serverPeerConfig);

         overrideAttributes(serverPeerObjectName, attrOverrides);

         // overwrite the config file security domain
         sc.setAttribute(serverPeerObjectName, "SecurityDomain",
                         MockJBossSecurityManager.TEST_SECURITY_DOMAIN);

         log.debug("starting JMS server");

         sc.invoke(serverPeerObjectName, "create", new Object[0], new String[0]);
         sc.invoke(serverPeerObjectName, "start", new Object[0], new String[0]);

         MBeanConfigurationElement postOfficeConfig =
            (MBeanConfigurationElement)pdd.query("service", "PostOffice").iterator().next();

         postOfficeObjectName = sc.registerAndConfigureService(postOfficeConfig);
         overrideAttributes(postOfficeObjectName, attrOverrides);
         sc.invoke(postOfficeObjectName, "create", new Object[0], new String[0]);
View Full Code Here

Examples of org.jboss.test.messaging.tools.jboss.MBeanConfigurationElement

         (jndiName != null ? "    <attribute name=\"JNDIName\">" + jndiName + "</attribute>" : "") +
         "       <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>" +
         "       <attribute name=\"Clustered\">" + String.valueOf(clustered) + "</attribute>" +
         "</mbean>";

      MBeanConfigurationElement mbean =
         new MBeanConfigurationElement(XMLUtil.stringToElement(config));
      ObjectName deston = sc.registerAndConfigureService(mbean);
      sc.invoke(deston, "create", new Object[0], new String[0]);
      sc.invoke(deston, "start", new Object[0], new String[0]);
   }
View Full Code Here

Examples of org.jboss.test.messaging.tools.jboss.MBeanConfigurationElement

         "    <attribute name=\"PageSize\">" + pageSize + "</attribute>" +
         "    <attribute name=\"DownCacheSize\">" + downCacheSize + "</attribute>" +
         "    <attribute name=\"Clustered\">" + String.valueOf(clustered) + "</attribute>" +
         "</mbean>";

      MBeanConfigurationElement mbean =
         new MBeanConfigurationElement(XMLUtil.stringToElement(config));
      ObjectName deston = sc.registerAndConfigureService(mbean);
      sc.invoke(deston, "create", new Object[0], new String[0]);
      sc.invoke(deston, "start", new Object[0], new String[0]);
   }
View Full Code Here

Examples of org.jboss.test.messaging.tools.jboss.MBeanConfigurationElement

      {
         config += "<binding>" + jndiBindings[i] + "</binding>\n";
      }
      config += "</bindings></attribute></mbean>";

      MBeanConfigurationElement mc = new MBeanConfigurationElement(XMLUtil.stringToElement(config));
      ObjectName on = sc.registerAndConfigureService(mc);
     
      log.trace("Object name is now: " + on);
     
      sc.invoke(on, "create", new Object[0], new String[0]);
View Full Code Here

Examples of org.jboss.test.messaging.tools.jboss.MBeanConfigurationElement

         "       xmbean-dd=\"xmdesc/somefile.xml\">" +
         "       <attribute name=\"SomeName\" value=\"SomeValue\"/>" +
         "</mbean>";

      Element e = XMLUtil.stringToElement(s);
      MBeanConfigurationElement mbeanConfig = new MBeanConfigurationElement(e);

      assertEquals(new ObjectName("somedomain:service=SomeService"), mbeanConfig.getObjectName());
      assertEquals("org.example.SomeClass", mbeanConfig.getMBeanClassName());
      assertTrue(mbeanConfig.dependencyOptionalAttributeNames().isEmpty());

      Set attributeNames = mbeanConfig.attributeNames();
      assertEquals(1, attributeNames.size());

      assertTrue(attributeNames.contains("SomeName"));

      assertEquals("SomeValue", mbeanConfig.getAttributeValue("SomeName"));
   }
View Full Code Here

Examples of org.jboss.test.messaging.tools.jboss.MBeanConfigurationElement

         "       xmbean-dd=\"xmdesc/somefile.xml\">" +
         "       <attribute name=\"SomeName\">SomeValue</attribute>" +
         "</mbean>";

      Element e = XMLUtil.stringToElement(s);
      MBeanConfigurationElement mbeanConfig = new MBeanConfigurationElement(e);

      assertEquals(new ObjectName("somedomain:service=SomeService"), mbeanConfig.getObjectName());
      assertEquals("org.example.SomeClass", mbeanConfig.getMBeanClassName());
      assertTrue(mbeanConfig.dependencyOptionalAttributeNames().isEmpty());

      Set attributeNames = mbeanConfig.attributeNames();
      assertEquals(1, attributeNames.size());

      assertTrue(attributeNames.contains("SomeName"));

      assertEquals("SomeValue", mbeanConfig.getAttributeValue("SomeName"));
   }
View Full Code Here

Examples of org.jboss.test.messaging.tools.jboss.MBeanConfigurationElement

         "       xmbean-dd=\"xmdesc/somefile.xml\">" +
         "       <attribute name=\"SomeName\" value=\"SomeValue\">SomeOtherValue</attribute>" +
         "</mbean>";

      Element e = XMLUtil.stringToElement(s);
      MBeanConfigurationElement mbeanConfig = new MBeanConfigurationElement(e);

      assertEquals(new ObjectName("somedomain:service=SomeService"), mbeanConfig.getObjectName());
      assertEquals("org.example.SomeClass", mbeanConfig.getMBeanClassName());
      assertTrue(mbeanConfig.dependencyOptionalAttributeNames().isEmpty());

      Set attributeNames = mbeanConfig.attributeNames();
      assertEquals(1, attributeNames.size());

      assertTrue(attributeNames.contains("SomeName"));

      assertEquals("SomeValue", mbeanConfig.getAttributeValue("SomeName"));
   }
View Full Code Here

Examples of org.jboss.test.messaging.tools.jboss.MBeanConfigurationElement

         "       xmbean-dd=\"xmdesc/somefile.xml\">" +
         "       <depends>somedomain:somekey=somevalue</depends>" +
         "</mbean>";

      Element e = XMLUtil.stringToElement(s);
      MBeanConfigurationElement mbeanConfig = new MBeanConfigurationElement(e);

      assertEquals(new ObjectName("somedomain:service=SomeService"), mbeanConfig.getObjectName());
      assertEquals("org.example.SomeClass", mbeanConfig.getMBeanClassName());
      assertTrue(mbeanConfig.dependencyOptionalAttributeNames().isEmpty());
      assertTrue(mbeanConfig.attributeNames().isEmpty());
   }
View Full Code Here

Examples of org.jboss.test.messaging.tools.jboss.MBeanConfigurationElement

         "       xmbean-dd=\"xmdesc/somefile.xml\">" +
         "       <depends optional-attribute-name=\"SomeName\">somedomain:somekey=somevalue</depends>" +
         "</mbean>";

      Element e = XMLUtil.stringToElement(s);
      MBeanConfigurationElement mbeanConfig = new MBeanConfigurationElement(e);

      assertEquals(new ObjectName("somedomain:service=SomeService"), mbeanConfig.getObjectName());
      assertEquals("org.example.SomeClass", mbeanConfig.getMBeanClassName());
      assertTrue(mbeanConfig.attributeNames().isEmpty());

      Set optionalAttributeNames = mbeanConfig.dependencyOptionalAttributeNames();
      assertEquals(1, optionalAttributeNames.size());
      assertTrue(optionalAttributeNames.contains("SomeName"));
      assertEquals("somedomain:somekey=somevalue",
                   mbeanConfig.getDependencyOptionalAttributeValue("SomeName"));
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.