User: chirino 
  Date: 01/09/24 20:34:46

  Modified:    src/main/org/jboss/jms/asf ServerSessionPoolFactory.java
                        StdServerSession.java StdServerSessionPool.java
                        StdServerSessionPoolFactory.java
  Log:
  Updated the MDB stuff so it supports local tx for both BMT and for CMT-NotSupported
  
  Revision  Changes    Path
  1.4       +4 -3      jboss/src/main/org/jboss/jms/asf/ServerSessionPoolFactory.java
  
  Index: ServerSessionPoolFactory.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/jms/asf/ServerSessionPoolFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServerSessionPoolFactory.java     2001/09/20 05:08:21     1.3
  +++ ServerSessionPoolFactory.java     2001/09/25 03:34:46     1.4
  @@ -17,7 +17,8 @@
    * Created: Wed Nov 29 15:55:21 2000
    *
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Peter Antman</a> .
  - * @version   $Revision: 1.3 $
  + * @author    <a href="mailto:[EMAIL PROTECTED]";>Hiram Chirino</a> .
  + * @version   $Revision: 1.4 $
    */
   public interface ServerSessionPoolFactory
   {
  @@ -43,7 +44,7 @@
       * @param isTransacted
       * @param ack
       * @param listener
  -    * @param isContainerManaged  Description of Parameter
  +    * @param useLocalTX  
       * @return                    A new pool.
       * @throws JMSException
       */
  @@ -51,7 +52,7 @@
            int maxSession,
            boolean isTransacted,
            int ack,
  -         boolean isContainerManaged,
  +         boolean useLocalTX,
            MessageListener listener)
             throws JMSException;
   }
  
  
  
  1.9       +16 -15    jboss/src/main/org/jboss/jms/asf/StdServerSession.java
  
  Index: StdServerSession.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/asf/StdServerSession.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- StdServerSession.java     2001/09/20 05:08:21     1.8
  +++ StdServerSession.java     2001/09/25 03:34:46     1.9
  @@ -30,7 +30,8 @@
    *
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Peter Antman</a> .
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
  - * @version   $Revision: 1.8 $
  + * @author    <a href="mailto:[EMAIL PROTECTED]";>Hiram Chirino</a> .
  + * @version   $Revision: 1.9 $
    */
   public class StdServerSession
          implements Runnable, ServerSession
  @@ -68,7 +69,7 @@
       * this allows us to get around the TX timeout problem when you have
       * extensive message processing.
       */
  -   private boolean useXAResouceDirectly;
  +   private boolean useLocalTX;
   
      /**
       * Create a <tt>StdServerSession</tt> .
  @@ -76,14 +77,14 @@
       * @param pool              The server session pool which we belong to.
       * @param session           Our session resource.
       * @param xaSession         Our XA session resource.
  -    * @param containerManaged  Description of Parameter
  +    * @param useLocalTX       Will this session be used in a global TX (we can 
optimize with 1 phase commit)
       * @throws JMSException     Transation manager was not found.
       * @exception JMSException  Description of Exception
       */
      StdServerSession(final StdServerSessionPool pool,
            final Session session,
            final XASession xaSession,
  -         final boolean containerManaged)
  +         final boolean useLocalTX)
             throws JMSException
      {
         // assert pool != null
  @@ -95,15 +96,15 @@
   
         try
         {
  -         this.useXAResouceDirectly = !containerManaged && 
Class.forName("org.jboss.mq.SpySession").isAssignableFrom(session.getClass());
  +         this.useLocalTX = useLocalTX && 
Class.forName("org.jboss.mq.SpySession").isAssignableFrom(session.getClass());
         }
         catch (ClassNotFoundException e)
         {
  -         this.useXAResouceDirectly = false;
  +         this.useLocalTX = false;
         }
   
  -      log.debug("initializing (pool, session, xaSession, useXAResouceDirectly): " +
  -            pool + ", " + session + ", " + xaSession + ", " + useXAResouceDirectly);
  +      log.debug("initializing (pool, session, xaSession, useLocalTX): " +
  +            pool + ", " + session + ", " + xaSession + ", " + useLocalTX);
   
         InitialContext ctx = null;
         try
  @@ -167,18 +168,18 @@
      {
         log.debug("running...");
   
  -      log.info("running (pool, session, xaSession, useXAResouceDirectly): " +
  -            ", " + session + ", " + xaSession + ", " + useXAResouceDirectly);
  +      log.info("running (pool, session, xaSession, useLocalTX): " +
  +            ", " + session + ", " + xaSession + ", " + useLocalTX);
   
  -      // Used if run with useXAResouceDirectly if true
  +      // Used if run with useLocalTX if true
         JBossMQTXInterface jbossMQTXInterface = null;
   
  -      // Used if run with useXAResouceDirectly if false
  +      // Used if run with useLocalTX if false
         Transaction trans = null;
         try
         {
   
  -         if (useXAResouceDirectly)
  +         if (useLocalTX)
            {
               // Use JBossMQ One Phase Commit to commit the TX
               jbossMQTXInterface = new JBossMQTXInterface(session);
  @@ -211,7 +212,7 @@
         {
            log.error("session failed to run; setting rollback only", e);
   
  -         if (useXAResouceDirectly)
  +         if (useLocalTX)
            {
               // Use JBossMQ One Phase Commit to commit the TX
               jbossMQTXInterface.setRollbackOnly();
  @@ -236,7 +237,7 @@
         {
            try
            {
  -            if (useXAResouceDirectly)
  +            if (useLocalTX)
               {
                  // Use JBossMQ One Phase Commit to commit the TX
                  jbossMQTXInterface.endTX();
  
  
  
  1.14      +7 -6      jboss/src/main/org/jboss/jms/asf/StdServerSessionPool.java
  
  Index: StdServerSessionPool.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/asf/StdServerSessionPool.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- StdServerSessionPool.java 2001/09/20 05:08:21     1.13
  +++ StdServerSessionPool.java 2001/09/25 03:34:46     1.14
  @@ -36,7 +36,8 @@
    * Created: Thu Dec 7 17:02:03 2000
    *
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Peter Antman</a> .
  - * @version   $Revision: 1.13 $
  + * @author    <a href="mailto:[EMAIL PROTECTED]";>Hiram Chirino</a> .
  + * @version   $Revision: 1.14 $
    */
   public class StdServerSessionPool
          implements ServerSessionPool
  @@ -70,7 +71,7 @@
      /**
       * Is the bean container managed?
       */
  -   private boolean containerManaged;
  +   private boolean useLocalTX;
   
      /**
       * True if this is a transacted session.
  @@ -116,13 +117,13 @@
       * @param ack
       * @param listener
       * @param maxSession
  -    * @param isContainerManaged  Description of Parameter
  +    * @param isuseLocalTX  Description of Parameter
       * @exception JMSException    Description of Exception
       */
      public StdServerSessionPool(final Connection con,
            final boolean transacted,
            final int ack,
  -         final boolean isContainerManaged,
  +         final boolean useLocalTX,
            final MessageListener listener,
            final int maxSession)
             throws JMSException
  @@ -133,7 +134,7 @@
         this.transacted = transacted;
         this.poolSize = maxSession;
         this.sessionPool = new ArrayList(maxSession);
  -      this.containerManaged = isContainerManaged;
  +      this.useLocalTX = useLocalTX;
   
         // setup the worker pool
         executor = new PooledExecutor(poolSize);
  @@ -365,7 +366,7 @@
            ses.setMessageListener(listener);
   
            // create the server session and add it to the pool
  -         ServerSession serverSession = new StdServerSession(this, ses, xaSes, 
containerManaged);
  +         ServerSession serverSession = new StdServerSession(this, ses, xaSes, 
useLocalTX);
            sessionPool.add(serverSession);
            numServerSessions++;
            log.debug("added server session to the pool: " + serverSession);
  
  
  
  1.7       +4 -3      
jboss/src/main/org/jboss/jms/asf/StdServerSessionPoolFactory.java
  
  Index: StdServerSessionPoolFactory.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/jms/asf/StdServerSessionPoolFactory.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- StdServerSessionPoolFactory.java  2001/09/20 05:08:21     1.6
  +++ StdServerSessionPoolFactory.java  2001/09/25 03:34:46     1.7
  @@ -19,7 +19,8 @@
    * Created: Fri Dec 22 09:47:41 2000
    *
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Peter Antman</a> .
  - * @version   $Revision: 1.6 $
  + * @author    <a href="mailto:[EMAIL PROTECTED]";>Hiram Chirino</a> .
  + * @version   $Revision: 1.7 $
    */
   public class StdServerSessionPoolFactory
          implements ServerSessionPoolFactory, Serializable
  @@ -70,9 +71,9 @@
       * @throws JMSException
       * @exception javax.jms.JMSException  Description of Exception
       */
  -   public javax.jms.ServerSessionPool getServerSessionPool(javax.jms.Connection 
con, int maxSession, boolean isTransacted, int ack, boolean isContainerManaged, 
javax.jms.MessageListener listener) throws javax.jms.JMSException
  +   public javax.jms.ServerSessionPool getServerSessionPool(javax.jms.Connection 
con, int maxSession, boolean isTransacted, int ack, boolean useLocalTX, 
javax.jms.MessageListener listener) throws javax.jms.JMSException
      {
  -      ServerSessionPool pool = (ServerSessionPool)new StdServerSessionPool(con, 
isTransacted, ack, isContainerManaged, listener, maxSession);
  +      ServerSessionPool pool = (ServerSessionPool)new StdServerSessionPool(con, 
isTransacted, ack, useLocalTX, listener, maxSession);
         return pool;
      }
   }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to