User: starksm 
  Date: 01/11/20 01:42:56

  Modified:    src/main/org/jboss/tm/plugins/tyrex Tag: Branch_2_4
                        ResourceInvoker.java TransactionManagerService.java
                        TyrexTransactionPropagationContextManager.java
                        TyrexTxPropagationContext.java
  Log:
  Change to the unified log4j based org.jboss.logging.Logger class.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.4.1   +96 -79    
jboss/src/main/org/jboss/tm/plugins/tyrex/Attic/ResourceInvoker.java
  
  Index: ResourceInvoker.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/tm/plugins/tyrex/Attic/ResourceInvoker.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- ResourceInvoker.java      2001/06/06 17:48:29     1.2
  +++ ResourceInvoker.java      2001/11/20 09:42:56     1.2.4.1
  @@ -30,85 +30,102 @@
    *        ResourceRemote,
    *        CoordinatorRemote
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Anatoly Akkerman</a>
  - *   @version $Revision: 1.2 $
  + *   @version $Revision: 1.2.4.1 $
    */
   
  -public class ResourceInvoker implements InvocationHandler, Externalizable {
  -
  -  private static Method prepare;
  -  private static Method rollback;
  -  private static Method commit;
  -  private static Method commit_one_phase;
  -  private static Method forget;
  -
  -  static {
  -    try {
  -      // get all the methods through which we may get called
  -      prepare = Resource.class.getMethod("prepare", null);
  -      rollback = Resource.class.getMethod("rollback", null);
  -      commit = Resource.class.getMethod("commit", null);
  -      commit_one_phase = Resource.class.getMethod("commit_one_phase", null);
  -      forget = Resource.class.getMethod("forget", null);
  -    }
  -    catch (Exception e) {
  -      e.printStackTrace();
  -    }
  -  }
  -
  -  private ResourceRemoteInterface remoteResource;
  -
  -  public ResourceInvoker() {
  -    // for externalization to work
  -  }
  -
  -  public ResourceInvoker(Resource res) {
  -    try {
  -      remoteResource = new ResourceRemote(res);
  -    } catch (Exception e) {
  -      e.printStackTrace();
  -      remoteResource = null;
  -      Logger.warning("ResourceInvoker did not initialize properly! Ther will be 
problems with this transaction!");
  -    }
  -  }
  -
  -  public void writeExternal(java.io.ObjectOutput out) throws IOException {
  -    out.writeObject(remoteResource);
  -  }
  -
  -  public void readExternal(java.io.ObjectInput in) throws IOException, 
ClassNotFoundException {
  -    this.remoteResource = (ResourceRemoteInterface) in.readObject();
  -  }
  -
  -  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable 
{
  -
  -    // Just call the appropriate method on our RemoteCoordinator
  -
  -    if (method.equals(prepare)) {
  -      // DEBUG      Logger.debug("ResourceInvoker: calling prepare()");
  -      return remoteResource.prepare();
  -    }
  -    else if (method.equals(rollback)) {
  -      // DEBUG      Logger.debug("ResourceInvoker: calling rollback()");
  -      remoteResource.rollback();
  -      return null;
  -    }
  -    else if (method.equals(commit)) {
  -      // DEBUG      Logger.debug("ResourceInvoker: calling commit()");
  -      remoteResource.commit();
  -      return null;
  -    }
  -    else if (method.equals(commit_one_phase)) {
  -      // DEBUG      Logger.debug("ResourceInvoker: calling commit_one_phase()");
  -      remoteResource.commit_one_phase();
  -      return null;
  -    }
  -    else if (method.equals(forget)) {
  -      // DEBUG      Logger.debug("ResourceInvoker: calling forget()");
  -      remoteResource.forget();
  -      return null;
  -    }
  -    else {
  -      throw new Exception("ResourceInvoker: called through an unknown method!");
  -    }
  -  }
  +public class ResourceInvoker implements InvocationHandler, Externalizable
  +{
  +   private static Logger log = Logger.getLogger(ResourceInvoker.class);
  +   private static Method prepare;
  +   private static Method rollback;
  +   private static Method commit;
  +   private static Method commit_one_phase;
  +   private static Method forget;
  +   
  +   static
  +   {
  +      try
  +      {
  +         // get all the methods through which we may get called
  +         prepare = Resource.class.getMethod("prepare", null);
  +         rollback = Resource.class.getMethod("rollback", null);
  +         commit = Resource.class.getMethod("commit", null);
  +         commit_one_phase = Resource.class.getMethod("commit_one_phase", null);
  +         forget = Resource.class.getMethod("forget", null);
  +      }
  +      catch (Exception e)
  +      {
  +         e.printStackTrace();
  +      }
  +   }
  +   
  +   private ResourceRemoteInterface remoteResource;
  +   
  +   public ResourceInvoker()
  +   {
  +      // for externalization to work
  +   }
  +   
  +   public ResourceInvoker(Resource res)
  +   {
  +      try
  +      {
  +         remoteResource = new ResourceRemote(res);
  +      } catch (Exception e)
  +      {
  +         e.printStackTrace();
  +         remoteResource = null;
  +         log.warn("ResourceInvoker did not initialize properly! Ther will be 
problems with this transaction!", e);
  +      }
  +   }
  +   
  +   public void writeExternal(java.io.ObjectOutput out) throws IOException
  +   {
  +      out.writeObject(remoteResource);
  +   }
  +   
  +   public void readExternal(java.io.ObjectInput in) throws IOException, 
ClassNotFoundException
  +   {
  +      this.remoteResource = (ResourceRemoteInterface) in.readObject();
  +   }
  +   
  +   public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
  +   {
  +      
  +      // Just call the appropriate method on our RemoteCoordinator
  +      
  +      if (method.equals(prepare))
  +      {
  +         // DEBUG      Logger.debug("ResourceInvoker: calling prepare()");
  +         return remoteResource.prepare();
  +      }
  +      else if (method.equals(rollback))
  +      {
  +         // DEBUG      Logger.debug("ResourceInvoker: calling rollback()");
  +         remoteResource.rollback();
  +         return null;
  +      }
  +      else if (method.equals(commit))
  +      {
  +         // DEBUG      Logger.debug("ResourceInvoker: calling commit()");
  +         remoteResource.commit();
  +         return null;
  +      }
  +      else if (method.equals(commit_one_phase))
  +      {
  +         // DEBUG      Logger.debug("ResourceInvoker: calling commit_one_phase()");
  +         remoteResource.commit_one_phase();
  +         return null;
  +      }
  +      else if (method.equals(forget))
  +      {
  +         // DEBUG      Logger.debug("ResourceInvoker: calling forget()");
  +         remoteResource.forget();
  +         return null;
  +      }
  +      else
  +      {
  +         throw new Exception("ResourceInvoker: called through an unknown method!");
  +      }
  +   }
   }
  
  
  
  1.1.4.2   +5 -5      
jboss/src/main/org/jboss/tm/plugins/tyrex/Attic/TransactionManagerService.java
  
  Index: TransactionManagerService.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/tm/plugins/tyrex/Attic/TransactionManagerService.java,v
  retrieving revision 1.1.4.1
  retrieving revision 1.1.4.2
  diff -u -r1.1.4.1 -r1.1.4.2
  --- TransactionManagerService.java    2001/10/20 21:02:15     1.1.4.1
  +++ TransactionManagerService.java    2001/11/20 09:42:56     1.1.4.2
  @@ -34,7 +34,7 @@
    *
    *  @see TyrexTransactionPropagationContextManager, tyrex.tm.TransactionDomain
    *  @author <a href="mailto:[EMAIL PROTECTED]";>Anatoly Akkerman</a>
  - *  @version $Revision: 1.1.4.1 $
  + *  @version $Revision: 1.1.4.2 $
    */
   public class TransactionManagerService
      extends ServiceMBeanSupport
  @@ -120,7 +120,7 @@
         }
         catch(NamingException e)
         {
  -         category.warn("Failed to stop service", e);
  +         log.warn("Failed to stop service", e);
         }
      }
   
  @@ -145,12 +145,12 @@
            if( url == null )
            {
               String msg = "Failed to find name: "+name+" as either a URL or a 
classpath resource";
  -            category.error(msg);
  +            log.error(msg);
               throw new IOException(msg);
            }
            configFile = url.toExternalForm();
         }
  -      category.info("Using configFile: "+configFile);
  +      log.info("Using configFile: "+configFile);
      }
   
      // ObjectFactory implementation ----------------------------------
  @@ -213,7 +213,7 @@
         }
         else
         {
  -         category.warn("TransactionManagerService: requested an unknown object:" + 
name);
  +         log.warn("TransactionManagerService: requested an unknown object:" + name);
            return null;
         }
         
  
  
  
  1.1.4.1   +4 -4      
jboss/src/main/org/jboss/tm/plugins/tyrex/Attic/TyrexTransactionPropagationContextManager.java
  
  Index: TyrexTransactionPropagationContextManager.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/tm/plugins/tyrex/Attic/TyrexTransactionPropagationContextManager.java,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- TyrexTransactionPropagationContextManager.java    2001/05/22 22:12:57     1.1
  +++ TyrexTransactionPropagationContextManager.java    2001/11/20 09:42:56     1.1.4.1
  @@ -27,7 +27,7 @@
    *
    *   @see TransactionManagerService
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Anatoly Akkerman</a>
  - *   @version $Revision: 1.1 $
  + *   @version $Revision: 1.1.4.1 $
    */
   
   public class TyrexTransactionPropagationContextManager implements
  @@ -39,6 +39,7 @@
     private static String JNDI_TPC_SENDER = "java:/TPCSender";
     private static String JNDI_TPC_RECEIVER = "java:/TPCReceiver";
     private static String JNDI_TM = "java:/TransactionManager";
  +  private static Logger log = 
Logger.getLogger(TyrexTransactionPropagationContextManager.class);
   
   // -- Private stuff ---------------------------------------------------
     private Sender sender = null;
  @@ -83,8 +84,7 @@
         }
       } catch (Exception e) {
         // DEBUG
  -      Logger.warning ("TyrexTransactionPropagationContextManager: unable to create 
propagation ctx!");
  -      e.printStackTrace();
  +      log.warn ("TyrexTransactionPropagationContextManager: unable to create 
propagation ctx!", e);
       } finally {
         return tpc;
       }
  @@ -154,7 +154,7 @@
         }
       }
       else {
  -      Logger.warning("TyrexTransactionPropagationContextManager: unknown Tx 
PropagationContex");
  +      log.warn("TyrexTransactionPropagationContextManager: unknown Tx 
PropagationContex");
         return null;
       }
     }
  
  
  
  1.2.4.1   +5 -6      
jboss/src/main/org/jboss/tm/plugins/tyrex/Attic/TyrexTxPropagationContext.java
  
  Index: TyrexTxPropagationContext.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/tm/plugins/tyrex/Attic/TyrexTxPropagationContext.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- TyrexTxPropagationContext.java    2001/06/06 17:48:29     1.2
  +++ TyrexTxPropagationContext.java    2001/11/20 09:42:56     1.2.4.1
  @@ -38,10 +38,11 @@
    *        org.omg.CosTransactions.Coordinator,
    *        java.lang.reflect.Proxy
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Anatoly Akkerman</a>
  - *   @version $Revision: 1.2 $
  + *   @version $Revision: 1.2.4.1 $
    */
   
   public class TyrexTxPropagationContext implements Externalizable {
  +   private static Logger log = Logger.getLogger(TyrexTxPropagationContext.class);
   
     public TyrexTxPropagationContext() {
       // public, no args constructor for externalization to work
  @@ -59,8 +60,7 @@
       } catch (RemoteException e) {
         // should never happen, we are instantiating the RemoteCoordinator
         // locally
  -      e.printStackTrace();
  -      Logger.warning("Impossible, CoordinatorRemote threw a RemoteException!");
  +      log.warn("Impossible, CoordinatorRemote threw a RemoteException!", e);
       }
     }
   
  @@ -98,8 +98,7 @@
           // DEBUG       Logger.debug("TPC: wrote otid");
         }
       } catch (Exception e) {
  -      Logger.warning("Unable to externalize tpc!");
  -      e.printStackTrace();
  +      log.warn("Unable to externalize tpc!", e);
         throw new IOException(e.toString());
       }
     }
  @@ -116,7 +115,7 @@
           // DEBUG      Logger.debug("TPC: read otid");
         }
       } catch (Exception e) {
  -      e.printStackTrace();
  +      log.warn("readExternal failure", e);
         throw new IOException (e.toString());
       }
     }
  
  
  

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

Reply via email to