[jboss-cvs] JBossAS SVN: r65308 - trunk/cluster/src/main/org/jboss/invocation/unified/interfaces.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Sep 11 17:55:42 EDT 2007


Author: bstansberry at jboss.com
Date: 2007-09-11 17:55:42 -0400 (Tue, 11 Sep 2007)
New Revision: 65308

Modified:
   trunk/cluster/src/main/org/jboss/invocation/unified/interfaces/UnifiedInvokerHAProxy.java
Log:
Use TRACE logging, not DEBUG

Modified: trunk/cluster/src/main/org/jboss/invocation/unified/interfaces/UnifiedInvokerHAProxy.java
===================================================================
--- trunk/cluster/src/main/org/jboss/invocation/unified/interfaces/UnifiedInvokerHAProxy.java	2007-09-11 21:43:47 UTC (rev 65307)
+++ trunk/cluster/src/main/org/jboss/invocation/unified/interfaces/UnifiedInvokerHAProxy.java	2007-09-11 21:55:42 UTC (rev 65308)
@@ -62,11 +62,14 @@
 
    public static final WeakHashMap txFailoverAuthorizations = new WeakHashMap();
 
+   /** Trace level logging flag only set when the proxy is created or read from JNDI */
+   private static boolean trace = false;
 
    public UnifiedInvokerHAProxy()
    {
       super();
-      log.debug("UnifiedInvokerHAProxy constructor called with no arguments.");
+      trace = log.isTraceEnabled();
+      log.trace("UnifiedInvokerHAProxy constructor called with no arguments.");
       setSubSystem("invokerha");
    }
 
@@ -79,7 +82,8 @@
       this.familyClusterInfo = ClusteringTargetsRepository.initTarget(proxyFamilyName, targets, viewId);
       this.loadBalancePolicy = policy;
       this.proxyFamilyName = proxyFamilyName;
-
+      trace = log.isTraceEnabled();
+      
       setSubSystem("invokerha");
    }
 
@@ -180,21 +184,30 @@
          try
          {
             invocation.setValue("CLUSTER_VIEW_ID", new Long(this.familyClusterInfo.getCurrentViewId()));
+            
+            if (trace)
+            {
+               log.debug("Client cluster view id: " + familyClusterInfo.getCurrentViewId());
+               log.debug(printPossibleTargets());
+            }
 
-            log.debug("Client cluster view id: " + familyClusterInfo.getCurrentViewId());
-            log.debug(printPossibleTargets());
-
             Client clientInstance = getClient(invocation);
 
-            log.debug("Making invocation on " + clientInstance.getInvoker().getLocator());
-
+            if (trace)
+            {
+               log.trace("Making invocation on " + clientInstance.getInvoker().getLocator());
+            }
+            
             response = clientInstance.invoke(invocation, null);
 
             HARMIResponse haResponse = null;
 
             if(response instanceof Exception)
             {
-               log.debug("Invocation returened exception: " + response);
+               if (trace)
+               {
+                  log.trace("Invocation returned exception: " + response);
+               }
                if(response instanceof GenericClusteringException)
                {
                   GenericClusteringException gcex = (GenericClusteringException) response;
@@ -225,7 +238,7 @@
                      failoverCounter++;
                      invocation.setValue("FAILOVER_COUNTER", new Integer(failoverCounter), PayloadKey.AS_IS);
 
-                     log.debug("Received GenericClusteringException where request was not completed.  Will retry.");
+                     log.trace("Received GenericClusteringException where request was not completed.  Will retry.");
 
                      continue;
                   }
@@ -261,7 +274,7 @@
          }
          catch(CannotConnectException cncEx)
          {
-            log.debug("Invocation failed: CannotConnectException - " + cncEx, cncEx);
+            log.trace("Invocation failed: CannotConnectException - " + cncEx, cncEx);
             removeDeadTarget(getLocator());
             resetView();
             failoverAuthorized = txContextAllowsFailover(invocation);
@@ -298,7 +311,7 @@
                failoverCounter++;
                invocation.setValue("FAILOVER_COUNTER", new Integer(failoverCounter), PayloadKey.AS_IS);
 
-               log.debug("Received GenericClusteringException where request was not completed.  Will retry.");
+               log.trace("Received GenericClusteringException where request was not completed.  Will retry.");
             }
             else
             {
@@ -308,7 +321,7 @@
          }
          catch(RemoteException aex)
          {
-            log.debug("Invocation failed: RemoteException - " + aex, aex);
+            log.trace("Invocation failed: RemoteException - " + aex, aex);
 
             // per Jira issue JBREM-61
             if(isStrictRMIException())
@@ -322,7 +335,7 @@
          }
          catch(Throwable throwable)
          {
-            log.debug("Invocation failed: " + throwable, throwable);
+            log.trace("Invocation failed: " + throwable, throwable);
 
             // this is somewhat of a hack as remoting throws throwable,
             // so will let Exception types bubble up, but if Throwable type,
@@ -374,7 +387,8 @@
          if(this.familyClusterInfo != null)
          {
             familyClusterInfo.removeDeadTarget(locator);
-            log.debug("Removed " + locator + " from target list.");
+            if (trace)
+               log.trace("Removed " + locator + " from target list.");
          }
       }
    }
@@ -449,6 +463,10 @@
          default:
             throw new StreamCorruptedException("Unknown version seen: " + version);
       }
+      
+      trace = log.isTraceEnabled();
+      if( trace )
+         log.trace("Init, clusterInfo: "+familyClusterInfo+", policy="+loadBalancePolicy);
    }
 
 




More information about the jboss-cvs-commits mailing list