User: tobyallsopp
  Date: 01/05/08 00:17:51

  Modified:    src/main/org/jboss/tm TransactionManagerService.java
                        TransactionManagerServiceMBean.java TxCapsule.java
  Log:
  Moved Xid class override from jboss.properties to an attribute of the
  TransactionManagerService MBean.  This is part of the deprecation of
  jboss.properties in favour of jboss.jcml.
  
  Revision  Changes    Path
  1.10      +16 -3     jboss/src/main/org/jboss/tm/TransactionManagerService.java
  
  Index: TransactionManagerService.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/tm/TransactionManagerService.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TransactionManagerService.java    2001/04/27 16:41:06     1.9
  +++ TransactionManagerService.java    2001/05/08 07:17:51     1.10
  @@ -37,7 +37,7 @@
    *  @see TxManager
    *  @author Rickard �berg ([EMAIL PROTECTED])
    *  @author <a href="mailto:[EMAIL PROTECTED]";>Ole Husgaard</a>
  - *  @version $Revision: 1.9 $
  + *  @version $Revision: 1.10 $
    */
   public class TransactionManagerService
      extends ServiceMBeanSupport
  @@ -50,9 +50,10 @@
       
      // Attributes ----------------------------------------------------
   
  -   MBeanServer server;
  +   private MBeanServer server;
   
  -   int timeout = 300; // default tx timeout, dupl. in TM when it exists.
  +   private int timeout = 300; // default tx timeout, dupl. in TM when it exists.
  +   private String xidClassName = null;
       
      // Static --------------------------------------------------------
   
  @@ -75,6 +76,15 @@
      protected void startService()
         throws Exception
      {
  +      // Initialize the Xid constructor.
  +      if (xidClassName != null) {
  +         log.log("Using Xid class '" + xidClassName + "'");
  +         Class cls = Class.forName(xidClassName);
  +
  +         TxCapsule.xidConstructor = cls.getConstructor(
  +            new Class[] { Integer.TYPE, byte[].class, byte[].class });
  +      }
  +
         // Get a reference to the TxManager singleton.
         tm = TxManager.getInstance();
         // Set its default timeout.
  @@ -115,6 +125,9 @@
         if (tm != null) // Update TM default timeout
            tm.setDefaultTransactionTimeout(timeout);
      }
  +
  +   public String getXidClassName() { return xidClassName; }
  +   public void setXidClassName(String name) { xidClassName = name; }
   
   
      // ObjectFactory implementation ----------------------------------
  
  
  
  1.4       +5 -1      jboss/src/main/org/jboss/tm/TransactionManagerServiceMBean.java
  
  Index: TransactionManagerServiceMBean.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/tm/TransactionManagerServiceMBean.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TransactionManagerServiceMBean.java       2000/12/07 15:45:17     1.3
  +++ TransactionManagerServiceMBean.java       2001/05/08 07:17:51     1.4
  @@ -12,7 +12,7 @@
    *      
    *   @see <related>
    *   @author Rickard �berg ([EMAIL PROTECTED])
  - *   @version $Revision: 1.3 $
  + *   @version $Revision: 1.4 $
    */
   public interface TransactionManagerServiceMBean
      extends org.jboss.util.ServiceMBean
  @@ -24,5 +24,9 @@
      public int getTransactionTimeout();
   
      public void setTransactionTimeout(int timeout);
  +
  +   public String getXidClassName();
  +
  +   public void setXidClassName(String name);
   }
   
  
  
  
  1.26      +4 -23     jboss/src/main/org/jboss/tm/TxCapsule.java
  
  Index: TxCapsule.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/tm/TxCapsule.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- TxCapsule.java    2001/04/17 01:29:06     1.25
  +++ TxCapsule.java    2001/05/08 07:17:51     1.26
  @@ -48,7 +48,7 @@
    *  @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
    *  @author <a href="mailto:[EMAIL PROTECTED]";>Ole Husgaard</a>
    *
  - *  @version $Revision: 1.25 $
  + *  @version $Revision: 1.26 $
    */
   class TxCapsule implements TimeoutTarget
   {
  @@ -66,29 +66,10 @@
   
      /**
       *  Constructor for Xid instances of specified class, or null.
  +    *  This is set from the <code>TransactionManagerService</code>
  +    *  MBean.
       */
  -   private static Constructor xidConstructor = null;
  -
  -   /**
  -    *  Initialize the Xid constructor.
  -    */
  -   static {
  -      String name = System.getProperty("jboss.xa.xidclass",
  -                                       "org.jboss.tm.XidImpl");
  -
  -      if (!name.equals("org.jboss.tm.XidImpl")) {
  -         try {
  -            Class cls = Class.forName(name);
  -
  -            xidConstructor = cls.getConstructor(new Class[]{ Integer.TYPE,
  -                                                             byte[].class,
  -                                                             byte[].class });
  -         } catch (Exception e) {
  -            System.out.println("Unable to load Xid class '"+name+"': " + e);
  -         }
  -      }
  -   }
  -
  +   static Constructor xidConstructor = null;
   
      /**
       *  This collection contains the inactive txCapsules.
  
  
  

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

Reply via email to