Package nexj.core.meta.integration.channel.jms

Examples of nexj.core.meta.integration.channel.jms.MessageQueue


         {
            Channel channel = (Channel)itr.next();

            if (channel instanceof MessageQueue && channel.isEnabled())
            {
               MessageQueue mq = (MessageQueue)channel;

               if (mq.isDestinationManaged() && mq.isFirst())
               {
                  String sMbeanName = "jboss.mq.destination:service=" + ((mq.isBroadcast()) ? "Topic" : "Queue") +
                  ",name=" + SysUtil.NAMESPACE + '/' + mq.getAlias();

                  if (mq.getDestination() == null)
                  {
                     Element mbean = XMLUtil.setChildElement(server, null, "mbean", "name", sMbeanName, null, true);

                     mbean.setAttribute("code", (mq.isBroadcast()) ? "org.jboss.mq.server.jmx.Topic" : "org.jboss.mq.server.jmx.Queue");

                     XMLUtil.setChildElement(mbean, null, "depends", "optional-attribute-name",
                        "DestinationManager", "jboss.mq:service=DestinationManager", true);

                     XMLUtil.setChildElement(mbean, null, "depends", "optional-attribute-name",
View Full Code Here


         {
            Channel channel = (Channel)itr.next();

            if (channel instanceof MessageQueue && channel.isEnabled())
            {
               MessageQueue mq = (MessageQueue)channel;

               if (mq.isDestinationManaged() && mq.isFirst())
               {
                  String sMbeanName = "jboss.messaging.destination:service=" +
                  ((mq.isBroadcast()) ? "Topic" : "Queue") + ",name=" + mq.getAlias();

                  if (mq.getDestination() == null)
                  {
                     Element mbean = XMLUtil.setChildElement(server, null, "mbean", "name", sMbeanName, null, true);

                     mbean.setAttribute("code", "org.jboss.jms.server.destination." + (mq.isBroadcast() ? "Topic" : "Queue") + "Service");
                     mbean.setAttribute("xmbean-dd", "xmdesc/" + (mq.isBroadcast() ? "Topic" : "Queue") + "-xmbean.xml");

                     XMLUtil.setChildElement(mbean, null, "depends", "optional-attribute-name", "ServerPeer", "jboss.messaging:service=ServerPeer", true);
                     XMLUtil.addChildElement(mbean, null, "depends", "jboss.messaging:service=PostOffice");
                     XMLUtil.addChildElement(mbean, null, "depends", "jboss.messaging:service=SecurityStore");
                     XMLUtil.setChildElement(mbean, null, "attribute", "name", "JNDIName", (mq.isBroadcast() ? "topic" : "queue") + '/' + SysUtil.NAMESPACE + '/' + mq.getAlias(), true);

                     if (m_metadata.isDistributed())
                     {
                        XMLUtil.setChildElement(mbean, null, "attribute", "name", "Clustered", "true", true);
                     }
View Full Code Here

         properties = new TransferObject(1);
      }

      if (channel instanceof MessageQueue)
      {
         MessageQueue mq = (MessageQueue)channel;

         if (!bNoLocal && mq.isLoopback() && mq.isBroadcast())
         {
            properties.setValue(JMSSender.NODE, "");
         }

         return JMS_MESSAGE_FACTORY;
View Full Code Here

      {
         Channel channel = (Channel)itr.next();

         if (channel instanceof MessageQueue && channel.isEnabled())
         {
            MessageQueue mq = (MessageQueue)channel;

            String sConnFactoryType = (channel.isTransactional()) ? "tx-connection-factory" : "no-tx-connection-factory";

            if (mq.isConnectionFactoryManaged())
            {
               String sCFJNDIName = getCFJNDIName(mq);
               Element connectionFactory = XMLUtil.findChildElementBySubelement(
                  connectionFactories, "tx-connection-factory", "jndi-name", sCFJNDIName);

               /*
                * If we change from tx-connection-factory to no-tx-connection-factory or the other way around
                * we delete the old definitions and create new ones from scratch
                */
               if (connectionFactory != null)
               {
                  if (!channel.isTransactional())
                  {
                     XMLUtil.removeNode(connectionFactory);

                     connectionFactory = null;
                  }
               }
               else
               {
                  connectionFactory = XMLUtil.findChildElementBySubelement(
                     connectionFactories, "no-tx-connection-factory", "jndi-name", sCFJNDIName);

                  if (connectionFactory != null)
                  {
                     if (channel.isTransactional())
                     {
                        XMLUtil.removeNode(connectionFactory);

                        connectionFactory = null;
                     }
                  }
               }

               if (mq.getConnectionFactory() == null)
               {
                  if (connectionFactory == null)
                  {
                     connectionFactory = doc.createElement(sConnFactoryType);
                     connectionFactories.appendChild(connectionFactory);
                  }

                  XMLUtil.setChildElement(connectionFactory, CONNECTION_FACTORY_ELEMENTS,
                     "jndi-name", sCFJNDIName, false);

                  XMLUtil.removeNode(XMLUtil.findChildElement(connectionFactory, "local-transaction"));

                  if (channel.isTransactional())
                  {
                     XMLUtil.setChildElement(connectionFactory, CONNECTION_FACTORY_ELEMENTS,
                        "xa-transaction", null, false);
                  }

                  XMLUtil.setChildElement(connectionFactory, CONNECTION_FACTORY_ELEMENTS,
                     "rar-name", "jms-ra.rar", false);
                  XMLUtil.setChildElement(connectionFactory, CONNECTION_FACTORY_ELEMENTS,
                     "connection-definition", "org.jboss.resource.adapter.jms.JmsConnectionFactory", false);

                  Element element = XMLUtil.findChildElement(connectionFactory, "config-property", "name", "SessionDefaultType");

                  if (element == null)
                  {
                     element = XMLUtil.addChildElement(connectionFactory, CONNECTION_FACTORY_ELEMENTS,
                        "config-property", "javax.jms.Topic");
                     XMLUtil.setAttribute(element, "name", "SessionDefaultType", true);
                     XMLUtil.setAttribute(element, "type", "java.lang.String", true);
                  }

                  element = XMLUtil.findChildElement(connectionFactory, "config-property", "name", "JmsProviderAdapterJNDI");

                  if (element == null)
                  {
                     element = XMLUtil.addChildElement(connectionFactory, CONNECTION_FACTORY_ELEMENTS,
                        "config-property", "java:/DefaultJMSProvider");
                     XMLUtil.setAttribute(element, "name", "JmsProviderAdapterJNDI", true);
                     XMLUtil.setAttribute(element, "type", "java.lang.String", true);
                  }

                  XMLUtil.setChildElement(connectionFactory, CONNECTION_FACTORY_ELEMENTS,
                     "max-pool-size", String.valueOf(mq.getMaxSenders() + ((mq.isReceivable()) ? 1 : 0)), true);
                  XMLUtil.setChildElement(connectionFactory, CONNECTION_FACTORY_ELEMENTS,
                     "security-domain-and-application", getJAASDomain(mq), true);
               }
               else
               {
View Full Code Here

      {
         Channel channel = (Channel)itr.next();

         if (channel instanceof MessageQueue && channel.isEnabled())
         {
            MessageQueue mq = (MessageQueue)channel;

            if (mq.isConnectionFactoryManaged())
            {
               Element connectionFactory = XMLUtil.findChildElementBySubelement(
                  connectionFactories, "tx-connection-factory", "jndi-name", getCFJNDIName(mq));

               if (connectionFactory == null)
View Full Code Here

      {
         Channel channel = (Channel)itr.next();

         if (channel instanceof MessageQueue && channel.isEnabled())
         {
            MessageQueue mq = (MessageQueue)channel;

            addApplicationPolicy(policies, getJAASDomain(channel), (channel.isTransactional()) ? "TxCM" : "NoTxCM", getCFJNDIName(mq), mq.getUser(), mq.getPassword());
         }
      }

      // Database connections require user and password
      for (Iterator dsItr = m_metadata.getDataSourceIterator(); dsItr.hasNext();)
View Full Code Here

         {
            Channel channel = (Channel)itr.next();

            if (channel instanceof MessageQueue && channel.isEnabled())
            {
               MessageQueue mq = (MessageQueue)channel;

               if (mq.isConnectionFactoryManaged())
               {
                  XMLUtil.removeNode(XMLUtil.findChildElement(doc.getDocumentElement(),
                     "application-policy", "name", getJAASDomain(mq)));
               }
            }
View Full Code Here

      {
         Channel roleChannel = (Channel)roleItr.next();

         if (roleChannel.isEnabled() && roleChannel instanceof MessageQueue)
         {
            MessageQueue roleMQ = (MessageQueue)roleChannel;

            if (roleMQ.getUser() != null && roleMQ.getAlias().equals(mq.getAlias()))
            {
               if (roleMQ.isReceivable())
               {
                  receivableUserSet.add(roleMQ.getUser());
               }

               if (roleMQ.isSendable())
               {
                  sendableUserSet.add(roleMQ.getUser());
               }
            }
         }
      }
View Full Code Here

         {
            Channel channel = (Channel)itr.next();

            if (channel instanceof MessageQueue)
            {
               MessageQueue mq = (MessageQueue)channel;

               if (mq.isSendable())
               {
                  ((JMSSender)mq.getSender().getInstance(null)).setEnabled(false);
               }
            }
         }

         boolean bReady = false;
View Full Code Here

TOP

Related Classes of nexj.core.meta.integration.channel.jms.MessageQueue

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.