User: osh     
  Date: 01/02/13 12:30:51

  Modified:    src/main/org/jboss/tm GlobalId.java TransactionImpl.java
  Log:
  Performance fix for non-optimized VM-local invocations
  with a transaction context.
  
  Revision  Changes    Path
  1.2       +8 -14     jboss/src/main/org/jboss/tm/GlobalId.java
  
  Index: GlobalId.java
  ===================================================================
  RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/tm/GlobalId.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- GlobalId.java     2001/02/09 19:34:35     1.1
  +++ GlobalId.java     2001/02/13 20:30:50     1.2
  @@ -16,9 +16,9 @@
    *
    *  @see XidImpl
    *  @author <a href="mailto:[EMAIL PROTECTED]">Ole Husgaard</a>
  - *  @version $Revision: 1.1 $
  + *  @version $Revision: 1.2 $
    */
  -class GlobalId
  +public class GlobalId
      implements java.io.Serializable
   {
      // Constants -----------------------------------------------------
  @@ -43,23 +43,17 @@
      // Constructors --------------------------------------------------
   
      /**
  -    *  Create a new instance.
  +    *  Create a new instance. This constructor is public <em>only</em>
  +    *  to get around a class loader problem; it should be package-private.
       */
  -   GlobalId(Xid xid)
  +   public GlobalId(int hash, byte[] globalId)
      {
  -      if (xid.getFormatId() != XidImpl.JBOSS_FORMAT_ID)
  -        throw new IllegalArgumentException("Bad transaction format id");
  -
  -      hash = xid.hashCode();
  -      if (xid instanceof XidImpl)
  -        globalId = ((XidImpl)xid).getInternalGlobalTransactionId();
  -      else
  -        globalId = xid.getGlobalTransactionId();
  +      this.hash = hash;
  +      this.globalId = globalId;
      }
   
  -   // Public --------------------------------------------------------
   
  -   // Xid implementation --------------------------------------------
  +   // Public --------------------------------------------------------
   
      /**
       *  Compare for equality.
  
  
  
  1.14      +5 -4      jboss/src/main/org/jboss/tm/TransactionImpl.java
  
  Index: TransactionImpl.java
  ===================================================================
  RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/tm/TransactionImpl.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TransactionImpl.java      2001/02/09 18:56:17     1.13
  +++ TransactionImpl.java      2001/02/13 20:30:50     1.14
  @@ -31,7 +31,7 @@
    *  @author Rickard �berg ([EMAIL PROTECTED])
    *  @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
    *  @author <a href="mailto:[EMAIL PROTECTED]">Ole Husgaard</a>
  - *  @version $Revision: 1.13 $
  + *  @version $Revision: 1.14 $
    */
   class TransactionImpl
      implements Transaction
  @@ -42,11 +42,12 @@
   
      // Constructors --------------------------------------------------
   
  -   TransactionImpl(TxCapsule txCapsule, Xid xid)
  +   TransactionImpl(TxCapsule txCapsule, XidImpl xid)
      {
         this.txCapsule = txCapsule;
         this.xid = xid;
  -      globalId = new GlobalId(xid);
  +      globalId = new GlobalId(xid.hashCode(),
  +                              xid.getInternalGlobalTransactionId());
      }
   
      // Public --------------------------------------------------------
  @@ -166,7 +167,7 @@
      // Package protected ---------------------------------------------
   
      /** The ID of this transaction. */
  -   Xid xid;
  +   XidImpl xid;
   
      /**
       *  Setter for property done.
  
  
  

Reply via email to