Examples of MBeanConfigurationElement


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

   public Properties getPostOfficeSQLProperties() throws Exception
   {
      String persistenceConfigFile = getPersistenceConfigFile(true);
      log.info("Persistence config file: .... " + persistenceConfigFile);
     
      MBeanConfigurationElement postOfficeConfig = ServiceConfigHelper
            .loadServiceConfiguration(persistenceConfigFile, "PostOffice");
     
      String props = postOfficeConfig.getAttributeValue("SqlProperties");
     
      if (props != null)
      {
         ByteArrayInputStream is = new ByteArrayInputStream(props.getBytes());
        
View Full Code Here

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

      // since that can lead
      // to deadlocks
     
      String configFileName = "remoting/remoting-" + transport + "-service.xml";
     
      MBeanConfigurationElement connectorServiceConfig = ServiceConfigHelper
            .loadServiceConfiguration(configFileName, "Connector");
     
      String invokerConfig = connectorServiceConfig
            .getAttributeValue("Configuration");
     
      Element invokerElement = (Element) XMLUtil.stringToElement(invokerConfig)
            .getElementsByTagName("invoker").item(0);
     
View Full Code Here

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

      else
      {
         log.info("Could find multiplexer config");
      }
     
      MBeanConfigurationElement multiplexerConfig = (MBeanConfigurationElement) services
            .iterator().next();
      ObjectName nameMultiplexer = registerAndConfigureService(multiplexerConfig);
      invoke(nameMultiplexer, "create", new Object[0], new String[0]);
      invoke(nameMultiplexer, "start", new Object[0], new String[0]);
   }
View Full Code Here

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

     
      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);
         overrideAttributes(on, attrOverrides);
         // dependencies have been automatically injected already
         invoke(on, "create", new Object[0], new String[0]);
View Full Code Here

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

         throw new Exception("Cannot find " + configFilePath + " in the classpath");
      }

      ServiceDeploymentDescriptor pdd = new ServiceDeploymentDescriptor(configFileURL);

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

      // first, we try to use a channel factory service, if we find one configured
      String s = (String)postOfficeConfig.getAttributeValue("ChannelFactoryName");

      if (s != null && !skipMultiplex)
      {
         // there's a chance we can use a multiplexer service
         ObjectName channelFactoryName = new ObjectName(s);

         String channelPartitionName =
            (String)postOfficeConfig.getAttributeValue("ChannelPartitionName");

         if (channelPartitionName == null)
         {
            throw new IllegalStateException("Cannot find ChannelPartitionName");
         }

         String syncChannelName = (String)postOfficeConfig.getAttributeValue("SyncChannelName");

         if (syncChannelName == null)
         {
            throw new IllegalStateException("Cannot find SyncChannelName");
         }

         String asyncChannelName = (String)postOfficeConfig.getAttributeValue("AsyncChannelName");

         if (asyncChannelName == null)
         {
            throw new IllegalStateException("Cannot find AsyncChannelName");
         }

         try
         {
            if(mbeanServer.getMBeanInfo(channelFactoryName) != null)
            {
               multiplexorDelegate =
                  new MultiplexerJChannelFactory(mbeanServer, channelFactoryName,
                                                 channelPartitionName, syncChannelName,
                                                 asyncChannelName);

               // initialization ends here, we've found what we were looking for
               return;
            }
         }
         catch (Exception e)
         {
            // that's alright, no multiplexer there, use the regular XML configuration
            log.debug("Wasn't able to find " + s);
         }
      }

      // the only chance now is to use the XML configurations

      s = (String)postOfficeConfig.getAttributeValue("SyncChannelConfig");

      if (s == null)
      {
         throw new IllegalStateException("Cannot find SyncChannelConfig");
      }

      syncConfig = XMLUtil.stringToElement(s);

      s = (String)postOfficeConfig.getAttributeValue("AsyncChannelConfig");

      if (s == null)
      {
         throw new IllegalStateException("Cannot find AsyncChannelConfig");
      }
View Full Code Here

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 = ServiceConfigHelper.loadConfigFile(mainConfigFile);

         ServiceDeploymentDescriptor pdd = ServiceConfigHelper.loadConfigFile(persistenceConfigFile);

         MBeanConfigurationElement persistenceManagerConfig = ServiceConfigHelper.getServiceConfiguration(pdd,
                                                                                                          "PersistenceManager");
         persistenceManagerObjectName = sc.registerAndConfigureService(persistenceManagerConfig);
         overrideAttributes(persistenceManagerObjectName, attrOverrides);
         toStop.add(persistenceManagerObjectName);
         sc.invoke(persistenceManagerObjectName, "create", new Object[0], new String[0]);
         sc.invoke(persistenceManagerObjectName, "start", new Object[0], new String[0]);

         MBeanConfigurationElement jmsUserManagerConfig = ServiceConfigHelper.getServiceConfiguration(pdd,
                                                                                                      "JMSUserManager");
         jmsUserManagerObjectName = sc.registerAndConfigureService(jmsUserManagerConfig);
         overrideAttributes(jmsUserManagerObjectName, attrOverrides);
         toStop.add(jmsUserManagerObjectName);
         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 = ServiceConfigHelper.getServiceConfiguration(mdd, "ServerPeer");

         // overwrite the file configuration, if needed
         overrideServerPeerConfiguration(serverPeerConfig,
                                         serverPeerID,
                                         defaultQueueJNDIContext,
                                         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");

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

         MBeanConfigurationElement postOfficeConfig = ServiceConfigHelper.getServiceConfiguration(pdd, "PostOffice");

         postOfficeObjectName = sc.registerAndConfigureService(postOfficeConfig);
         sc.setAttribute(postOfficeObjectName, "Clustered", clustered ? "true" : "false");

         overrideAttributes(postOfficeObjectName, attrOverrides);
View Full Code Here

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

                      "jboss.messaging.destination:service=Queue,name=" +
                      expq +
                      "</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]);
      return deston;
   }
View Full Code Here

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

                      "jboss.messaging.destination:service=Queue,name=" +
                      expq +
                      "</attribute>" +
                      "</mbean>";

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

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

                      "       <attribute name=\"Clustered\">" +
                      String.valueOf(b) +
                      "</attribute>" +
                      "</mbean>";

      MBeanConfigurationElement mbean = new MBeanConfigurationElement(XMLUtil.stringToElement(config));
      ObjectName deston = sc.registerAndConfigureService(mbean);
      sc.invoke(deston, "create", new Object[0], new String[0]);
      return deston;
   }
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.