[jboss-cvs] JBossAS SVN: r108958 - projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Oct 27 23:23:43 EDT 2010


Author: pferraro
Date: 2010-10-27 23:23:42 -0400 (Wed, 27 Oct 2010)
New Revision: 108958

Modified:
   projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManager.java
Log:
Drop log levels to trace

Modified: projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManager.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManager.java	2010-10-28 02:03:01 UTC (rev 108957)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManager.java	2010-10-28 03:23:42 UTC (rev 108958)
@@ -187,7 +187,7 @@
    @Override
    public void sessionCreated(String sessionId)
    {
-      // Do nothing
+      trace("sessionCreated(%s)", sessionId);
    }
 
    /**
@@ -199,10 +199,7 @@
    {
       final String sessionId = sessionData.getRealId();
       
-      if (log.isTraceEnabled())
-      {
-         log.trace("putSession(): putting session " + mask(sessionId));
-      }     
+      trace("storeSessionData(%s)", sessionId);
       
       Operation<Void> operation = new Operation<Void>()
       {
@@ -230,6 +227,8 @@
    @Override
    public IncomingDistributableSessionData getSessionData(String sessionId, boolean initialLoad)
    {
+      trace("getSessionData(%s, %s)", sessionId, initialLoad);
+      
       return this.getData(sessionId, true);
    }
 
@@ -240,6 +239,8 @@
    @Override
    public IncomingDistributableSessionData getSessionData(final String sessionId, String dataOwner, boolean includeAttributes)
    {
+      trace("getSessionData(%s, %s, %s)", sessionId, dataOwner, includeAttributes);
+      
       return (dataOwner == null) ? this.getData(sessionId, includeAttributes) : null;
    }
    
@@ -300,7 +301,8 @@
    @Override
    public void removeSession(final String sessionId)
    {
-      log.info(String.format("removeSession(%s)", sessionId));
+      trace("removeSession(%s)", sessionId);
+      
       this.removeSession(sessionId, false);
    }
 
@@ -311,7 +313,8 @@
    @Override
    public void removeSessionLocal(final String sessionId)
    {
-      log.info(String.format("removeSessionLocal(%s)", sessionId));
+      trace("removeSessionLocal(%s)", sessionId);
+      
       this.removeSession(sessionId, true);
    }
 
@@ -341,7 +344,8 @@
    @Override
    public void removeSessionLocal(String sessionId, String dataOwner)
    {
-      log.info(String.format("removeSessionLocal(%s, %s)", sessionId, dataOwner));
+      trace("removeSessionLocal(%s, dataOwner)", sessionId, dataOwner);
+      
       if (dataOwner == null)
       {
          this.removeSession(sessionId, true);
@@ -355,7 +359,8 @@
    @Override
    public void evictSession(final String sessionId)
    {
-      log.info(String.format("evictSession(%s)", sessionId));
+      trace("evictSession(%s)", sessionId);
+      
       Operation<Void> operation = new Operation<Void>()
       {
          @Override
@@ -376,7 +381,8 @@
    @Override
    public void evictSession(String sessionId, String dataOwner)
    {
-      log.info(String.format("evictSession(%s, %s)", sessionId, dataOwner));
+      trace("evictSession(%s, %s)", sessionId, dataOwner);
+      
       if (dataOwner == null)
       {
          this.evictSession(sessionId);
@@ -433,7 +439,8 @@
    @Override
    public LockResult acquireSessionOwnership(String sessionId, boolean newLock) throws TimeoutException, InterruptedException
    {
-      log.info(String.format("acquireSessionOwnership(%s, %s)", sessionId, newLock));
+      trace("acquireSessionOwnership(%s, %s)", sessionId, newLock);
+      
       LockResult result = lockResultMap.get(this.lockManager.lock(this.getSessionLockKey(sessionId), this.sessionCache.getAdvancedCache().getConfiguration().getLockAcquisitionTimeout(), newLock));
       
       return (result != null) ? result : LockResult.UNSUPPORTED;
@@ -442,7 +449,8 @@
    @Override
    public void relinquishSessionOwnership(String sessionId, boolean remove)
    {
-      log.info(String.format("relinquishSessionOwnership(%s, %s)", sessionId, remove));
+      trace("relinquishSessionOwnership(%s, %s)", sessionId, remove);
+      
       this.lockManager.unlock(this.getSessionLockKey(sessionId), remove);
    }
    
@@ -456,11 +464,11 @@
     * @see org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager#isLocal(java.lang.String)
     */
    @Override
-   public boolean isLocal(String realId)
+   public boolean isLocal(String sessionId)
    {
       DistributionManager manager = this.sessionCache.getAdvancedCache().getDistributionManager();
       
-      return (manager != null) ? manager.isLocal(realId) : true;
+      return (manager != null) ? manager.isLocal(sessionId) : true;
    }
 
    /**
@@ -597,6 +605,14 @@
       }
    }
    
+   private static void trace(String message, Object... args)
+   {
+      if (log.isTraceEnabled())
+      {
+         log.trace(String.format(message, args));
+      }
+   }
+   
    // Simplified CacheInvoker.Operation using assigned key/value types
    static interface Operation<R> extends CacheInvoker.Operation<String, Map<Object, Object>, R>
    {



More information about the jboss-cvs-commits mailing list