[jbosscache-commits] JBoss Cache SVN: r6962 - in core/branches/2.2.X/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:12:16 EDT 2008


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

Modified:
   core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
   core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
   core/branches/2.2.X/src/main/java/org/jboss/cache/transaction/DummyTransaction.java
Log:
[JBCACHE-1428] Use trace field instead of log.isTraceEnabled()

Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java	2008-10-15 19:59:40 UTC (rev 6961)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java	2008-10-15 20:12:16 UTC (rev 6962)
@@ -123,7 +123,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
@@ -191,7 +191,7 @@
    {
       if (ctx.getOptionOverrides() != null && ctx.getOptionOverrides().isCacheModeLocal())
       {
-         if (log.isTraceEnabled()) log.trace("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/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java	2008-10-15 19:59:40 UTC (rev 6961)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java	2008-10-15 20:12:16 UTC (rev 6962)
@@ -97,7 +97,7 @@
       Object result = null;
 
       // this is a prepare, commit, or rollback.
-      if (log.isTraceEnabled()) log.trace("Got gtx from invocation context " + ctx.getGlobalTransaction());
+      if (trace) log.trace("Got gtx from invocation context " + ctx.getGlobalTransaction());
       try
       {
          if (ctx.getGlobalTransaction().isRemote())
@@ -146,7 +146,7 @@
                // make sure we set this in the ctx
                ctx.setTransaction(ltx);
             }
-            if (log.isTraceEnabled()) log.trace(" 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++;
          }
@@ -162,7 +162,7 @@
             // this tx has completed.  Clean up in the tx table.
             txTable.remove(gtx, ltx);
          }
-         if (log.isTraceEnabled()) log.trace("Finished remote rollback method for " + gtx);
+         if (trace) log.trace("Finished remote rollback method for " + gtx);
       }
       catch (Throwable throwable)
       {
@@ -204,7 +204,7 @@
                // make sure we set this in the ctx
                ctx.setTransaction(ltx);
             }
-            if (log.isTraceEnabled()) log.trace("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++;
          }
@@ -222,7 +222,7 @@
             // this tx has completed.  Clean up in the tx table.
             txTable.remove(gtx, ltx);
          }
-         if (log.isTraceEnabled()) log.trace("Finished remote commit/rollback method for " + gtx);
+         if (trace) log.trace("Finished remote commit/rollback method for " + gtx);
       }
       catch (Throwable throwable)
       {
@@ -337,7 +337,7 @@
             txTable.put(ltx, gtx);
             if (trace) log.trace("Created new tx for gtx " + gtx);
 
-            if (log.isTraceEnabled())
+            if (trace)
                log.trace("Started new local tx as result of remote prepare: local tx=" + ltx + " (status=" + ltx.getStatus() + "), gtx=" + gtx);
          }
          else
@@ -366,7 +366,7 @@
          if (entry == null)
          {
             // create a new transaction entry
-            if (log.isTraceEnabled()) log.trace("creating new tx entry");
+            if (trace) log.trace("creating new tx entry");
             entry = createNewTransactionEntry(ltx);
             txTable.put(gtx, entry);
          }
@@ -442,7 +442,7 @@
          txManager.suspend();// suspends ltx - could be null
          // resume whatever else we had going.
          if (currentTx != null) txManager.resume(currentTx);
-         if (log.isTraceEnabled()) log.trace("Finished remote prepare " + gtx);
+         if (trace) log.trace("Finished remote prepare " + gtx);
       }
 
       return retval;
@@ -545,7 +545,7 @@
          ctx.setCommand(originalCommand);
          ctx.setMethodCall(null);
       }
-      if (log.isTraceEnabled()) log.trace("Finished local commit/rollback method for " + gtx);
+      if (trace) log.trace("Finished local commit/rollback method for " + gtx);
       return result;
    }
 
@@ -969,7 +969,7 @@
             {
                case Status.STATUS_COMMITTED:
                   boolean onePhaseCommit = isOnePhaseCommit();
-                  if (log.isTraceEnabled()) log.trace("Running commit phase.  One phase? " + onePhaseCommit);
+                  if (trace) log.trace("Running commit phase.  One phase? " + onePhaseCommit);
                   runCommitPhase(ctx, gtx, modifications, onePhaseCommit);
                   log.trace("Finished commit phase");
                   break;

Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/transaction/DummyTransaction.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/transaction/DummyTransaction.java	2008-10-15 19:59:40 UTC (rev 6961)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/transaction/DummyTransaction.java	2008-10-15 20:12:16 UTC (rev 6962)
@@ -27,11 +27,13 @@
    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();
    }
 
    /**
@@ -234,7 +236,7 @@
             throw new IllegalStateException("illegal status: " + status + " tx=" + this);
       }
 
-      if (log.isTraceEnabled())
+      if (trace)
       {
          log.trace("registering synchronization handler " + sync);
       }
@@ -253,7 +255,7 @@
 
       for (Synchronization s : participants)
       {
-         if (log.isTraceEnabled())
+         if (trace)
          {
             log.trace("processing beforeCompletion for " + s);
          }
@@ -274,7 +276,7 @@
    {
       for (Synchronization s : participants)
       {
-         if (log.isTraceEnabled())
+         if (trace)
          {
             log.trace("processing afterCompletion for " + s);
          }




More information about the jbosscache-commits mailing list