geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject svn commit: r553508 - in /geronimo/server/trunk/modules: geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/ geronimo-clustering/src/main/java/org/apache/geronimo/clustering/ geronimo-jetty6/src/test/java/org/apache/geronimo/jet...
Date Thu, 05 Jul 2007 14:00:18 GMT
Author: gdamour
Date: Thu Jul  5 07:00:13 2007
New Revision: 553508

URL: http://svn.apache.org/viewvc?view=rev&rev=553508
Log:
Add SessionManager.getRemoteNodes so that clients know which Nodes are hosting the sessions
managed by a clustered
SessionManager.

Provide a WADI implementation of this contract.

Modified:
    geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/BasicWADISessionManager.java
    geronimo/server/trunk/modules/geronimo-clustering/src/main/java/org/apache/geronimo/clustering/SessionManager.java
    geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/ApplicationTest.java

Modified: geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/BasicWADISessionManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/BasicWADISessionManager.java?view=diff&rev=553508&r1=553507&r2=553508
==============================================================================
--- geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/BasicWADISessionManager.java
(original)
+++ geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/BasicWADISessionManager.java
Thu Jul  5 07:00:13 2007
@@ -16,10 +16,13 @@
  */
 package org.apache.geronimo.clustering.wadi;
 
+import java.util.HashSet;
 import java.util.Iterator;
+import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.clustering.BasicNode;
 import org.apache.geronimo.clustering.Node;
 import org.apache.geronimo.clustering.Session;
 import org.apache.geronimo.clustering.SessionAlreadyExistException;
@@ -33,6 +36,7 @@
 import org.codehaus.wadi.core.manager.Manager;
 import org.codehaus.wadi.core.manager.SessionMonitor;
 import org.codehaus.wadi.group.Dispatcher;
+import org.codehaus.wadi.group.Peer;
 import org.codehaus.wadi.replication.manager.ReplicationManagerFactory;
 import org.codehaus.wadi.replication.storage.ReplicaStorageFactory;
 import org.codehaus.wadi.replication.strategy.BackingStrategyFactory;
@@ -126,6 +130,15 @@
         return dispatcherHolder.getNode();
     }
 
+    public Set<Node> getRemoteNodes() {
+        Set<Node> nodes = new HashSet<Node>();
+        Set<Peer> peers = serviceSpace.getHostingPeers();
+        for (Peer peer : peers) {
+            nodes.add(new BasicNode(peer.getName()));
+        }
+        return nodes;
+    }
+
     public void registerListener(SessionListener listener) {
         listeners.add(listener);
     }
@@ -212,4 +225,5 @@
     public static GBeanInfo getGBeanInfo() {
         return GBEAN_INFO;
     }
+
 }

Modified: geronimo/server/trunk/modules/geronimo-clustering/src/main/java/org/apache/geronimo/clustering/SessionManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-clustering/src/main/java/org/apache/geronimo/clustering/SessionManager.java?view=diff&rev=553508&r1=553507&r2=553508
==============================================================================
--- geronimo/server/trunk/modules/geronimo-clustering/src/main/java/org/apache/geronimo/clustering/SessionManager.java
(original)
+++ geronimo/server/trunk/modules/geronimo-clustering/src/main/java/org/apache/geronimo/clustering/SessionManager.java
Thu Jul  5 07:00:13 2007
@@ -16,6 +16,8 @@
  */
 package org.apache.geronimo.clustering;
 
+import java.util.Set;
+
 /**
  * Represents a local SessionManager.
  * <p>
@@ -58,4 +60,10 @@
      */
     Node getNode();
 
+    /**
+     * Gets the remote Nodes hosting the corresponding remote SessionManagers.
+     * 
+     * @return Hosting Node.
+     */
+    Set<Node> getRemoteNodes();
 }

Modified: geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/ApplicationTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/ApplicationTest.java?view=diff&rev=553508&r1=553507&r2=553508
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/ApplicationTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/ApplicationTest.java
Thu Jul  5 07:00:13 2007
@@ -22,6 +22,8 @@
 import java.io.InputStreamReader;
 import java.net.HttpURLConnection;
 import java.net.URL;
+import java.util.Collections;
+import java.util.Set;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
@@ -83,6 +85,10 @@
 
         public Node getNode() {
             return node;
+        }
+        
+        public Set<Node> getRemoteNodes() {
+            return Collections.EMPTY_SET;
         }
     }
 



Mime
View raw message