Package org.jboss.test.messaging.tools.jboss

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


         if (persistenceConfigFileURL == null)
         {
            throw new Exception("Cannot find " + persistenceConfigFile + " in the classpath");
         }

         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]);
         sc.invoke(postOfficeObjectName, "start", new Object[0], new String[0]);
View Full Code Here


         "  </mbean>"  +
         "  <mbean name=\"someotherdomain:somekey=somevalue\"" +
         "         code=\"org.example.SomeClass\"/>" +
         "</service>";

      ServiceDeploymentDescriptor sdd = new ServiceDeploymentDescriptor(s);

      List list;

      list = sdd.query("service", "SomeService");
      assertEquals(1, list.size());
      MBeanConfigurationElement e = (MBeanConfigurationElement)list.get(0);
      assertNotNull(e);

      list = sdd.query("somekey", "somevalue");
      assertEquals(1, list.size());
      e = (MBeanConfigurationElement)list.get(0);
      assertNotNull(e);

      list = sdd.query("somekey", "nothing");
      assertTrue(list.isEmpty());

      list = sdd.query("nosuchkey", "somevalue");
      assertTrue(list.isEmpty());

   }
View Full Code Here

      if (persistenceConfigFileURL == null)
      {
         throw new Exception("Cannot find " + persistenceConfigFile + " in the classpath");
      }

      ServiceDeploymentDescriptor pdd = new ServiceDeploymentDescriptor(persistenceConfigFileURL);

      MBeanConfigurationElement persistenceManagerConfig =
         (MBeanConfigurationElement)pdd.query("service", "PersistenceManager").iterator().next();

      String props = persistenceManagerConfig.getAttributeValue("SqlProperties");

      if (props != null)
      {
View Full Code Here

      if (persistenceConfigFileURL == null)
      {
         throw new Exception("Cannot find " + persistenceConfigFile + " in the classpath");
      }

      ServiceDeploymentDescriptor pdd = new ServiceDeploymentDescriptor(persistenceConfigFileURL);

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

      String props = postOfficeConfig.getAttributeValue("SqlProperties");

      if (props != null)
      {
View Full Code Here

      if (persistenceConfigFileURL == null)
      {
         throw new Exception("Cannot find " + persistenceConfigFile + " in the classpath");
      }

      ServiceDeploymentDescriptor pdd = new ServiceDeploymentDescriptor(persistenceConfigFileURL);

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

      String props = postOfficeConfig.getAttributeValue("SqlProperties");

      if (props != null)
      {
View Full Code Here

      if (multiplexerCofigURL == null)
      {
         throw new Exception("Cannot find " + multiplexerCofigURL + " in the classpath");
      }

      ServiceDeploymentDescriptor multiplexerDD =
         new ServiceDeploymentDescriptor(multiplexerCofigURL);

      List services = multiplexerDD.query("name", "Multiplexer");

      if (services.isEmpty())
      {
         log.info("Couldn't find multiplexer config");
      }
View Full Code Here

      if (connFactoryConfigFileURL == null)
      {
         throw new Exception("Cannot find " + connFactoryConfigFile + " in the classpath");
      }

      ServiceDeploymentDescriptor cfdd =
         new ServiceDeploymentDescriptor(connFactoryConfigFileURL);
      List connFactoryElements = cfdd.query("service", "ConnectionFactory");
      if (connFactoryElements.isEmpty())
      {
         connFactoryElements = cfdd.query("service", "HTTPConnectionFactory");
      }
      connFactoryObjectNames.clear();
      for (Iterator i = connFactoryElements.iterator(); i.hasNext();)
      {
         MBeanConfigurationElement connFactoryElement = (MBeanConfigurationElement) i.next();
View Full Code Here

      if (multiplexerCofigURL == null)
      {
         throw new Exception("Cannot find " + multiplexerCofigURL + " in the classpath");
      }

      ServiceDeploymentDescriptor multiplexerDD = ServiceConfigHelper.loadConfigFile(channelFactory);

      List services = multiplexerDD.query("service", "ChannelFactory");

      if (services.isEmpty())
      {
         log.info("Couldn't find multiplexer config");
      }
View Full Code Here

   public void deployConnectionFactories(String connFactoryConfigFile,
                                         ServiceAttributeOverrides attrOverrides) throws Exception
   {
      connFactoryObjectNames.clear();

      ServiceDeploymentDescriptor cfdd = ServiceConfigHelper.loadConfigFile(connFactoryConfigFile);

      List connFactoryElements = cfdd.query("service", "ConnectionFactory");

      for (Iterator i = connFactoryElements.iterator(); i.hasNext();)
      {
         MBeanConfigurationElement connFactoryElement = (MBeanConfigurationElement) i.next();
         ObjectName on = registerAndConfigureService(connFactoryElement);
         overrideAttributes(on, attrOverrides);
         // dependencies have been automatically injected already
         invoke(on, "create", new Object[0], new String[0]);
         invoke(on, "start", new Object[0], new String[0]);
         connFactoryObjectNames.add(on);
      }

      connFactoryElements = cfdd.query("service", "ClusteredConnectionFactory");

      for (Iterator i = connFactoryElements.iterator(); i.hasNext();)
      {
         MBeanConfigurationElement connFactoryElement = (MBeanConfigurationElement) i.next();
         ObjectName on = registerAndConfigureService(connFactoryElement);
         overrideAttributes(on, attrOverrides);
         // dependencies have been automatically injected already
         invoke(on, "create", new Object[0], new String[0]);
         invoke(on, "start", new Object[0], new String[0]);
         connFactoryObjectNames.add(on);
      }

      connFactoryElements = cfdd.query("service", "HTTPConnectionFactory");

      for (Iterator i = connFactoryElements.iterator(); i.hasNext();)
      {
         MBeanConfigurationElement connFactoryElement = (MBeanConfigurationElement) i.next();
         ObjectName on = registerAndConfigureService(connFactoryElement);
         overrideAttributes(on, attrOverrides);
         // dependencies have been automatically injected already
         invoke(on, "create", new Object[0], new String[0]);
         invoke(on, "start", new Object[0], new String[0]);
         connFactoryObjectNames.add(on);
      }

      connFactoryElements = cfdd.query("service", "ClusterPullConnectionFactory");

      for (Iterator i = connFactoryElements.iterator(); i.hasNext();)
      {
         MBeanConfigurationElement connFactoryElement = (MBeanConfigurationElement) i.next();
         ObjectName on = registerAndConfigureService(connFactoryElement);
View Full Code Here

        
         String persistenceConfigFile = sc.getPersistenceConfigFile(clustered);

         log.info(" Persistence config file .. " + persistenceConfigFile);

         ServiceDeploymentDescriptor mdd = ServiceConfigHelper.loadConfigFile(mainConfigFile);
        
         ServiceDeploymentDescriptor pdd = ServiceConfigHelper.loadConfigFile(persistenceConfigFile);

         MBeanConfigurationElement persistenceManagerConfig =
            ServiceConfigHelper.getServiceConfiguration(pdd, "PersistenceManager");
         persistenceManagerObjectName = sc.registerAndConfigureService(persistenceManagerConfig);
         overrideAttributes(persistenceManagerObjectName, attrOverrides);
View Full Code Here

TOP

Related Classes of org.jboss.test.messaging.tools.jboss.ServiceDeploymentDescriptor

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.