Package nexj.core.rpc.jms.ra.platform

Examples of nexj.core.rpc.jms.ra.platform.JMSPlatformAdapter


    * @see nexj.core.rpc.ra.GenericResourceAdapter#createConsumerPool(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec)
    */
   protected GenericConsumerPool createConsumerPool(MessageEndpointFactory factory, ActivationSpec cfg) throws ResourceException
   {
      JMSConsumerConfig config = (JMSConsumerConfig)cfg;
      JMSPlatformAdapter platform = getJMSPlatformAdapter(config.getConnectionFactory());
     
      if (platform != null)
      {
         return new JMSPlatformConsumerPool(this, factory, config, platform);
      }
View Full Code Here


      List xaResList = new ArrayList();

      for (int i = 0; i < specs.length; i++)
      {
         JMSConsumerConfig jmsConsumerConfig = (JMSConsumerConfig)specs[i];
         JMSPlatformAdapter jmsPlatformAdapter = getJMSPlatformAdapter(jmsConsumerConfig.getConnectionFactory());
        
         if (jmsPlatformAdapter == null)
         {
            try
            {
               xaResList.add(new JMSXAResource(getJMSEngineAdapter(
                  jmsConsumerConfig.getConnectionFactory(), jmsConsumerConfig.getConnectionFactoryPropertyMap()), jmsConsumerConfig.getAcknowledgeMode() == null));
            }
            catch (Throwable t)
            {
               s_logger.error("Error retrieving JMSEngineAdapter for JMS connection factory " +
                  jmsConsumerConfig.getConnectionFactory(), t);
            }
         }
         else
         {
            try
            {
               XAResource[] platformXAResArray = jmsPlatformAdapter.createResourceAdapter(jmsConsumerConfig).
                  getXAResources(new ActivationSpec[]{jmsPlatformAdapter.createActivationSpec(jmsConsumerConfig)});
              
               if (platformXAResArray != null)
               {
                  for (int k = 0; k < platformXAResArray.length; k++)
                  {
                     xaResList.add(platformXAResArray[k]);
                  }
               }
               else
               {
                  xaResList.add(new XAResource()
                  {
                     // operations

                     /**
                      * @see javax.transaction.xa.XAResource#commit(javax.transaction.xa.Xid, boolean)
                      */
                     public void commit(Xid xid, boolean bOnePhase) throws XAException
                     {
                     }

                     /**
                      * @see javax.transaction.xa.XAResource#end(javax.transaction.xa.Xid, int)
                      */
                     public void end(Xid xid, int nFlags) throws XAException
                     {
                     }

                     /**
                      * @see javax.transaction.xa.XAResource#forget(javax.transaction.xa.Xid)
                      */
                     public void forget(Xid xid) throws XAException
                     {
                     }

                     /**
                      * @see javax.transaction.xa.XAResource#getTransactionTimeout()
                      */
                     public int getTransactionTimeout() throws XAException
                     {
                        return 0;
                     }

                     /**
                      * @see javax.transaction.xa.XAResource#isSameRM(javax.transaction.xa.XAResource)
                      */
                     public boolean isSameRM(XAResource xar) throws XAException
                     {
                        return xar == this;
                     }

                     /**
                      * @see javax.transaction.xa.XAResource#prepare(javax.transaction.xa.Xid)
                      */
                     public int prepare(Xid xid) throws XAException
                     {
                        return 0;
                     }

                     /**
                      * JMS message recovery is handled by the JMS engine.
                      *
                      * @see javax.transaction.xa.XAResource#recover(int)
                      */
                     public Xid[] recover(int nFlag) throws XAException
                     {
                        return new Xid[0];
                     }

                     /**
                      * @see javax.transaction.xa.XAResource#rollback(javax.transaction.xa.Xid)
                      */
                     public void rollback(Xid xid) throws XAException
                     {
                     }

                     /**
                      * @see javax.transaction.xa.XAResource#setTransactionTimeout(int)
                      */
                     public boolean setTransactionTimeout(int nSeconds) throws XAException
                     {
                        return true;
                     }

                     /**
                      * @see javax.transaction.xa.XAResource#start(javax.transaction.xa.Xid, int)
                      */
                     public void start(Xid xid, int nFlag) throws XAException
                     {
                     }
                  });
               }
            }
            catch (Throwable t)
            {
               s_logger.error("Error retrieving platform resource adapter for platform adapter" +
                  jmsPlatformAdapter.getClass().getName(), t);
            }
         }
      }
     
      XAResource[] xaResArray = new XAResource[xaResList.size()];
View Full Code Here

TOP

Related Classes of nexj.core.rpc.jms.ra.platform.JMSPlatformAdapter

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.