geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r487952 - /geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/cluster/ClusteredSessionManager.java
Date Sun, 17 Dec 2006 09:00:17 GMT
Author: djencks
Date: Sun Dec 17 01:00:17 2006
New Revision: 487952

URL: http://svn.apache.org/viewvc?view=rev&rev=487952
Log:
GERONIMO-2669 partial fix for changes in AbstractSessionManager so g. will compile, but presumably
the clusteredsessionManager won't actually work

Modified:
    geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/cluster/ClusteredSessionManager.java

Modified: geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/cluster/ClusteredSessionManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/cluster/ClusteredSessionManager.java?view=diff&rev=487952&r1=487951&r2=487952
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/cluster/ClusteredSessionManager.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/cluster/ClusteredSessionManager.java
Sun Dec 17 01:00:17 2006
@@ -29,14 +29,13 @@
 
 
 /**
- *
  * @version $Rev$ $Date$
  */
 public class ClusteredSessionManager extends AbstractSessionManager {
-    
+
     private final SessionManager sessionManager;
     private final Map<String, ClusteredSession> idToSession = new HashMap<String,
ClusteredSession>();
-    
+
     public ClusteredSessionManager(SessionManager sessionManager) {
         this.sessionManager = sessionManager;
 
@@ -45,7 +44,7 @@
         HashSessionIdManager sessionIdManager = new HashSessionIdManager();
         sessionIdManager.setWorkerName(workerName);
         setMetaManager(sessionIdManager);
-        
+
         sessionManager.registerListener(new MigrationListener());
 
         // sessions are not removed by this manager. They are invalidated via a callback
mechanism
@@ -57,16 +56,64 @@
         return new ClusteredSession(request);
     }
 
+    @Override
+    protected void addSession(Session session) {
+        //todo gianni fixme
+        synchronized (idToSession) {
+            idToSession.put(session.getId(), (ClusteredSession) session);
+        }
+    }
+
+    @Override
+    protected void removeSession(String idInCluster) {
+        //todo gianni fixme
+        synchronized (idToSession) {
+            idToSession.remove(idInCluster);
+        }
+    }
+
+    @Override
+    protected Session getSession(String idInCluster) {
+        //todo gianni fixme
+        synchronized (idToSession) {
+            return idToSession.get(idInCluster);
+        }
+    }
+
+    @Override
+    public int getSessions() {
+        //todo gianni fixme
+        synchronized (idToSession) {
+            return idToSession.size();
+        }
+    }
+
+
+    /**
+     * @deprecated. Need to review if it is needed.
+     */
+    @Override
+    public Map getSessionMap() {
+        //todo gianni fixme
+        return idToSession;
+    }
+
+    @Override
+    protected void invalidateSessions() {
+        //todo gianni fixme
+    }
+
+
     private class MigrationListener implements SessionListener {
-        
+
         public void notifyInboundSessionMigration(org.apache.geronimo.clustering.Session
session) {
             addSession(new ClusteredSession(session), false);
         }
-        
+
         public void notifyOutboundSessionMigration(org.apache.geronimo.clustering.Session
session) {
             ClusteredSession clusteredSession;
             synchronized (idToSession) {
-                clusteredSession = (ClusteredSession) idToSession.remove(session.getSessionId());
 
+                clusteredSession = (ClusteredSession) idToSession.remove(session.getSessionId());
             }
             if (null == clusteredSession) {
                 throw new AssertionError("Session [" + session + "] is undefined");
@@ -89,7 +136,7 @@
                 idToSession.put(getId(), this);
             }
         }
-        
+
         protected ClusteredSession(org.apache.geronimo.clustering.Session session) {
             super(session.getSessionId());
             this.session = session;
@@ -97,7 +144,7 @@
                 idToSession.put(getId(), this);
             }
         }
-        
+
         @Override
         protected Map newAttributeMap() {
             return session.getState();



Mime
View raw message