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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jul 29 15:53:31 EDT 2010


Author: smarlow at redhat.com
Date: 2010-07-29 15:53:31 -0400 (Thu, 29 Jul 2010)
New Revision: 107215

Modified:
   projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/web/tomcat/service/session/sso/SSOClusterManagerImpl.java
Log:
JBCLUSTER-286 a little cleaner

Modified: projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/web/tomcat/service/session/sso/SSOClusterManagerImpl.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/web/tomcat/service/session/sso/SSOClusterManagerImpl.java	2010-07-29 17:53:10 UTC (rev 107214)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/web/tomcat/service/session/sso/SSOClusterManagerImpl.java	2010-07-29 19:53:31 UTC (rev 107215)
@@ -69,9 +69,6 @@
    public static final String DEFAULT_THREAD_POOL_NAME =
       "jboss.system:service=ThreadPool";
 
-   /** The default JBoss Cache to use for storing SSO entries */
-   public static final String DEFAULT_CACHE_NAME = "clustered-sso";
-
    // -------------------------------------------------------  Instance Fields
 
    /**
@@ -89,10 +86,6 @@
     */
    private volatile ThreadLocal<String> beingRemotelyRemoved = new ThreadLocal<String>();
 
-   /**
-    * String name to use to access the TreeCache
-    */
-   private volatile String cacheName = DEFAULT_CACHE_NAME;
 
    /**
     * ObjectName of the TreeCache if legacy JMX integration is used
@@ -151,8 +144,7 @@
 
    /**
     * The new members of the last view passed to viewChange()
-    * TODO:  figure out how to set this at startup time as
-    * we did with the JBC implementation.  
+    * TODO:  figure out how to get cluster view members at startup time
     */
    private final Set<Object> currentView = new HashSet<Object>();;
 
@@ -161,19 +153,6 @@
 
    private volatile InfinispanHAPartitionCacheHandler<CacheKey, Object> cacheHandler;
 
-   // ----------------------------------------------------------  Constructors
-
-
-   /**
-    * Creates a new SSOClusterManagerImpl that works with the given
-    * MBeanServer.  This constructor is only intended for use in unit testing.
-    */
-   //public SSOClusterManagerImpl(MBeanServer server)
-   //{
-   //   this.server = server;
-   //}
-
-
    // ------------------------------------------------------------  Properties
 
    public InfinispanHAPartitionCacheHandler getCacheHandler()
@@ -186,11 +165,6 @@
       this.cacheHandler = cacheHandler;
    }
 
-   public String getCacheName()
-   {
-      return cacheName;
-   }
-
    public String getThreadPoolName()
    {
       return threadPoolName;
@@ -295,11 +269,6 @@
          {
             server = ssoValve.getMBeanServer();
          }
-         String config = ssoValve.getCacheConfig();
-         if (config != null)
-         {
-            cacheName = config;
-         }
          String poolName = ssoValve.getThreadPoolName();
          if (poolName != null)
          {
@@ -557,7 +526,7 @@
     * does nothing.
     */
    @ViewChanged
-   public synchronized void viewChange(ViewChangedEvent event)
+   public void viewChange(ViewChangedEvent event)
    {
       log.debug("Received ViewChangedEvent " + event);
 
@@ -1060,8 +1029,7 @@
 
    private void logMissingCacheError()
    {
-      StringBuffer msg = new StringBuffer("Cannot find Cache using ");
-      msg.append(getCacheName());
+      StringBuffer msg = new StringBuffer("Cache is not set");
       msg.append(" -- Cache must be started before SSOClusterManagerImpl ");
       msg.append("can handle requests");
 
@@ -1130,28 +1098,28 @@
             if(doTx)
                tm.begin();
 
-            Set<FullyQualifiedSessionId> peers = getSSOSessions(ssoId);
-            if (peers != null && peers.size() > 0)
+            Set<FullyQualifiedSessionId> fullyQualifiedSessionIds = getSSOSessions(ssoId);
+            if (fullyQualifiedSessionIds != null && fullyQualifiedSessionIds.size() > 0)
             {
-               for (FullyQualifiedSessionId peer : peers)
+               for (FullyQualifiedSessionId fullyQualifiedSessionId : fullyQualifiedSessionIds)
                {
-                  boolean alive = true;
+                  boolean alive;
                   synchronized (currentView)
                   {
-                     alive = currentView.contains(peer.getHostName());
+                     alive = currentView.contains(fullyQualifiedSessionId.getHostName());
                   }
                   if (!alive)
                   {
                      if (log.isTraceEnabled())
                      {
-                        log.trace("Removing peer " + peer + " from SSO " + ssoId);
+                        log.trace("Removing peer " + fullyQualifiedSessionId + " from SSO " + ssoId);
                      }
 
                      // Remove the peer node, but local-only
                      // Each cache is responsible for cleaning itself
                      // TODO:  either make the following local only or only
                      // do the remove on the master cluster node.
-                     removeSessionFromCache(ssoId, peer);
+                     removeSessionFromCache(ssoId, fullyQualifiedSessionId);
                   }
                }
             }



More information about the jboss-cvs-commits mailing list