[jbosscache-commits] JBoss Cache SVN: r6964 - in core/trunk/src/main/java/org/jboss/cache: transaction and 1 other directory.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Wed Oct 15 16:24:43 EDT 2008


Author: bstansberry at jboss.com
Date: 2008-10-15 16:24:43 -0400 (Wed, 15 Oct 2008)
New Revision: 6964

Modified:
   core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
   core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
   core/trunk/src/main/java/org/jboss/cache/transaction/DummyTransaction.java
Log:
[JBCACHE-1428] Remove per-request DEBUG logging

Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java	2008-10-15 20:23:22 UTC (rev 6963)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java	2008-10-15 20:24:43 UTC (rev 6964)
@@ -141,7 +141,7 @@
 
       if (!sync && replicationQueue != null && !usingBuddyReplication)
       {
-         if (log.isDebugEnabled()) log.debug("Putting call " + call + " on the replication queue.");
+         if (trace) log.trace("Putting call " + call + " on the replication queue.");
          replicationQueue.add(commandsFactory.buildReplicateCommand(call));
       }
       else
@@ -209,7 +209,7 @@
    {
       if (ctx.getOptionOverrides() != null && ctx.getOptionOverrides().isCacheModeLocal())
       {
-         if (log.isDebugEnabled()) log.debug("LOCAL mode forced on invocation.  Suppressing clustered events.");
+         if (trace) log.trace("LOCAL mode forced on invocation.  Suppressing clustered events.");
          return true;
       }
       return false;

Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java	2008-10-15 20:23:22 UTC (rev 6963)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java	2008-10-15 20:24:43 UTC (rev 6964)
@@ -117,7 +117,7 @@
       Object result = null;
 
       // this is a prepare, commit, or rollback.
-      if (log.isDebugEnabled()) log.debug("Got gtx from invocation context " + ctx.getGlobalTransaction());
+      if (trace) log.trace("Got gtx from invocation context " + ctx.getGlobalTransaction());
       try
       {
          if (ctx.getGlobalTransaction().isRemote())
@@ -165,7 +165,7 @@
                // make sure we set this in the ctx
                ctx.setTransaction(ltx);
             }
-            if (log.isDebugEnabled()) log.debug(" executing commit() with local TX " + ltx + " under global tx " + gtx);
+            if (trace) log.trace(" executing commit() with local TX " + ltx + " under global tx " + gtx);
             txManager.commit();
             if (getStatisticsEnabled()) commits++;
          }
@@ -181,7 +181,7 @@
             // this tx has completed.  Clean up in the tx table.
             txTable.remove(gtx, ltx);
          }
-         if (log.isDebugEnabled()) log.debug("Finished remote rollback method for " + gtx);
+         if (trace) log.trace("Finished remote rollback method for " + gtx);
       }
       catch (Throwable throwable)
       {
@@ -223,7 +223,7 @@
                // make sure we set this in the ctx
                ctx.setTransaction(ltx);
             }
-            if (log.isDebugEnabled()) log.debug("executing with local TX " + ltx + " under global tx " + gtx);
+            if (trace) log.trace("executing with local TX " + ltx + " under global tx " + gtx);
             txManager.rollback();
             if (getStatisticsEnabled()) rollbacks++;
          }
@@ -241,7 +241,7 @@
             // this tx has completed.  Clean up in the tx table.
             txTable.remove(gtx, ltx);
          }
-         if (log.isDebugEnabled()) log.debug("Finished remote commit/rollback method for " + gtx);
+         if (trace) log.trace("Finished remote commit/rollback method for " + gtx);
       }
       catch (Throwable throwable)
       {
@@ -322,8 +322,8 @@
             txTable.put(ltx, gtx);
             if (trace) log.trace("Created new tx for gtx " + gtx);
 
-            if (log.isDebugEnabled())
-               log.debug("Started new local tx as result of remote prepare: local tx=" + ltx + " (status=" + ltx.getStatus() + "), gtx=" + gtx);
+            if (trace)
+               log.trace("Started new local tx as result of remote prepare: local tx=" + ltx + " (status=" + ltx.getStatus() + "), gtx=" + gtx);
          }
          else
          {
@@ -351,7 +351,7 @@
          if (transactionContext == null)
          {
             // create a new transaction transactionContext
-            if (log.isDebugEnabled()) log.debug("creating new tx transactionContext");
+            if (trace) log.trace("creating new tx transactionContext");
             transactionContext = contextFactory.createTransactionContext(ltx);
             txTable.put(gtx, transactionContext);
          }
@@ -427,7 +427,7 @@
          txManager.suspend();// suspends ltx - could be null
          // resume whatever else we had going.
          if (currentTx != null) txManager.resume(currentTx);
-         if (log.isDebugEnabled()) log.debug("Finished remote prepare " + gtx);
+         if (trace) log.trace("Finished remote prepare " + gtx);
       }
 
       return retval;
@@ -518,7 +518,7 @@
          ctx.setCommand(originalCommand);
          ctx.setMethodCall(null);
       }
-      if (log.isDebugEnabled()) log.debug("Finished local commit/rollback method for " + gtx);
+      if (trace) log.trace("Finished local commit/rollback method for " + gtx);
       return result;
    }
 
@@ -909,17 +909,17 @@
             {
                case Status.STATUS_COMMITTED:
                   boolean onePhaseCommit = isOnePhaseCommit();
-                  if (log.isDebugEnabled()) log.debug("Running commit phase.  One phase? " + onePhaseCommit);
+                  if (trace) log.trace("Running commit phase.  One phase? " + onePhaseCommit);
                   runCommitPhase(ctx, gtx, modifications, onePhaseCommit);
-                  log.debug("Finished commit phase");
+                  log.trace("Finished commit phase");
                   break;
                case Status.STATUS_UNKNOWN:
                   log.warn("Received JTA STATUS_UNKNOWN in afterCompletion()!  XA resources may not be in sync.  The app should manually clean up resources at this point.");
                case Status.STATUS_MARKED_ROLLBACK:
                case Status.STATUS_ROLLEDBACK:
-                  log.debug("Running rollback phase");
+                  log.trace("Running rollback phase");
                   runRollbackPhase(ctx, gtx, tx);
-                  log.debug("Finished rollback phase");
+                  log.trace("Finished rollback phase");
                   break;
 
                default:

Modified: core/trunk/src/main/java/org/jboss/cache/transaction/DummyTransaction.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/DummyTransaction.java	2008-10-15 20:23:22 UTC (rev 6963)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/DummyTransaction.java	2008-10-15 20:24:43 UTC (rev 6964)
@@ -48,11 +48,13 @@
    protected DummyBaseTransactionManager tm_;
 
    protected final Set<Synchronization> participants = new CopyOnWriteArraySet<Synchronization>();
+   private boolean trace;
 
    public DummyTransaction(DummyBaseTransactionManager tm)
    {
       tm_ = tm;
       status = Status.STATUS_ACTIVE;
+      trace = log.isTraceEnabled();
    }
 
    /**
@@ -254,9 +256,9 @@
             throw new IllegalStateException("illegal status: " + status + " tx=" + this);
       }
 
-      if (log.isDebugEnabled())
+      if (trace)
       {
-         log.debug("registering synchronization handler " + sync);
+         log.trace("registering synchronization handler " + sync);
       }
       participants.add(sync);
 
@@ -273,9 +275,9 @@
 
       for (Synchronization s : participants)
       {
-         if (log.isDebugEnabled())
+         if (trace)
          {
-            log.debug("processing beforeCompletion for " + s);
+            log.trace("processing beforeCompletion for " + s);
          }
          try
          {
@@ -294,9 +296,9 @@
    {
       for (Synchronization s : participants)
       {
-         if (log.isDebugEnabled())
+         if (trace)
          {
-            log.debug("processing afterCompletion for " + s);
+            log.trace("processing afterCompletion for " + s);
          }
          try
          {




More information about the jbosscache-commits mailing list