geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject svn commit: r514334 - in /geronimo/server/trunk: ./ configs/jetty6-clustering-builder-wadi/ configs/wadi-clustering/ modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/ modules/geronimo-jetty6-clustering-wadi/src/main/ja...
Date Sun, 04 Mar 2007 02:21:21 GMT
Author: gdamour
Date: Sat Mar  3 18:21:20 2007
New Revision: 514334

URL: http://svn.apache.org/viewvc?view=rev&rev=514334
Log:
* Move to latest WADI API: many classes have been repackaged such that it
is easier to comprehend the WADI code base.

* WADI has now in-built support for notification of inbound and outbound 
session migrations. This means, that we can get ride of MotionTracker.

* WADI now uses the same Tribes version than the one recently defined
to add clustering to Tomcat.

Modified:
    geronimo/server/trunk/configs/jetty6-clustering-builder-wadi/pom.xml
    geronimo/server/trunk/configs/wadi-clustering/pom.xml
    geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/BasicWADISessionManager.java
    geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/WADISessionAdaptor.java
    geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/WADISessionManager.java
    geronimo/server/trunk/modules/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/wadi/WADIClusteredPreHandler.java
    geronimo/server/trunk/modules/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/wadi/WADIClusteredPreHandlerFactory.java
    geronimo/server/trunk/pom.xml

Modified: geronimo/server/trunk/configs/jetty6-clustering-builder-wadi/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/jetty6-clustering-builder-wadi/pom.xml?view=diff&rev=514334&r1=514333&r2=514334
==============================================================================
--- geronimo/server/trunk/configs/jetty6-clustering-builder-wadi/pom.xml (original)
+++ geronimo/server/trunk/configs/jetty6-clustering-builder-wadi/pom.xml Sat Mar  3 18:21:20
2007
@@ -86,7 +86,7 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.catalina.tribes</groupId>
+            <groupId>org.apache.tomcat</groupId>
             <artifactId>tribes</artifactId>
         </dependency>
     </dependencies>

Modified: geronimo/server/trunk/configs/wadi-clustering/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/wadi-clustering/pom.xml?view=diff&rev=514334&r1=514333&r2=514334
==============================================================================
--- geronimo/server/trunk/configs/wadi-clustering/pom.xml (original)
+++ geronimo/server/trunk/configs/wadi-clustering/pom.xml Sat Mar  3 18:21:20 2007
@@ -72,7 +72,7 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.catalina.tribes</groupId>
+            <groupId>org.apache.tomcat</groupId>
             <artifactId>tribes</artifactId>
         </dependency>
     </dependencies>

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=514334&r1=514333&r2=514334
==============================================================================
--- 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
Sat Mar  3 18:21:20 2007
@@ -29,27 +29,15 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.codehaus.wadi.Contextualiser;
-import org.codehaus.wadi.Emoter;
-import org.codehaus.wadi.Evicter;
-import org.codehaus.wadi.Immoter;
-import org.codehaus.wadi.Invocation;
-import org.codehaus.wadi.InvocationException;
-import org.codehaus.wadi.Motable;
-import org.codehaus.wadi.PoolableInvocationWrapperPool;
-import org.codehaus.wadi.SessionMonitor;
-import org.codehaus.wadi.core.ConcurrentMotableMap;
+import org.codehaus.wadi.core.assembler.StackContext;
+import org.codehaus.wadi.core.manager.ClusteredManager;
+import org.codehaus.wadi.core.manager.SessionMonitor;
 import org.codehaus.wadi.group.Dispatcher;
-import org.codehaus.wadi.impl.ClusteredManager;
-import org.codehaus.wadi.impl.MemoryContextualiser;
-import org.codehaus.wadi.impl.StackContext;
 import org.codehaus.wadi.replication.manager.ReplicationManagerFactory;
 import org.codehaus.wadi.replication.storage.ReplicaStorageFactory;
 import org.codehaus.wadi.replication.strategy.BackingStrategyFactory;
 import org.codehaus.wadi.servicespace.ServiceSpace;
 import org.codehaus.wadi.servicespace.ServiceSpaceName;
-import org.codehaus.wadi.web.WebSession;
-import org.codehaus.wadi.web.WebSessionFactory;
 
 import edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArrayList;
 
@@ -96,15 +84,7 @@
                 configInfo.getSweepInterval(),
                 repManagerFactory,
                 repStorageFactory,
-                backingStrategyFactory) {
-            @Override
-            protected MemoryContextualiser newMemoryContextualiser(Contextualiser next,
-                    ConcurrentMotableMap mmap,
-                    Evicter mevicter,
-                    PoolableInvocationWrapperPool requestPool) {
-                return new MotionTracker(next, mevicter, mmap, sessionFactory, requestPool);
-            }
-        };
+                backingStrategyFactory);
         stackContext.build();
 
         serviceSpace = stackContext.getServiceSpace();
@@ -129,10 +109,10 @@
     }
 
     public Session createSession(String sessionId) throws SessionAlreadyExistException {
-        WebSession session;
+        org.codehaus.wadi.core.session.Session session;
         try {
             session = manager.createWithName(sessionId);
-        } catch (org.codehaus.wadi.SessionAlreadyExistException e) {
+        } catch (org.codehaus.wadi.core.manager.SessionAlreadyExistException e) {
             throw new SessionAlreadyExistException(sessionId);
         }
         return new WADISessionAdaptor(session);
@@ -154,111 +134,42 @@
         listeners.remove(listener);
     }
 
-    private void notifyInboundSessionMigration(WebSession webSession) {
+    private void notifyInboundSessionMigration(org.codehaus.wadi.core.session.Session session)
{
         for (Iterator iter = listeners.iterator(); iter.hasNext();) {
             SessionListener listener = (SessionListener) iter.next();
-            listener.notifyInboundSessionMigration(new WADISessionAdaptor(webSession));
+            listener.notifyInboundSessionMigration(new WADISessionAdaptor(session));
         }
     }
 
-    private WebSession notifyOutboundSessionMigration(WebSession webSession) {
+    private void notifyOutboundSessionMigration(org.codehaus.wadi.core.session.Session session)
{
         for (Iterator iter = listeners.iterator(); iter.hasNext();) {
             SessionListener listener = (SessionListener) iter.next();
-            listener.notifyOutboundSessionMigration(new WADISessionAdaptor(webSession));
+            listener.notifyOutboundSessionMigration(new WADISessionAdaptor(session));
         }
-        return webSession;
     }
 
-    private WebSession notifySessionDestruction(WebSession webSession) {
+    private void notifySessionDestruction(org.codehaus.wadi.core.session.Session session)
{
         for (Iterator iter = listeners.iterator(); iter.hasNext();) {
             SessionListener listener = (SessionListener) iter.next();
-            listener.notifySessionDestruction(new WADISessionAdaptor(webSession));
+            listener.notifySessionDestruction(new WADISessionAdaptor(session));
         }
-        return webSession;
     }
 
-    private class MotionTracker extends MemoryContextualiser {
-        private final Immoter immoter;
-        private final Emoter emoter;
+    private class SessionListenerAdapter implements org.codehaus.wadi.core.manager.SessionListener
{
 
-        public MotionTracker(Contextualiser next,
-                Evicter evicter,
-                ConcurrentMotableMap map,
-                WebSessionFactory sessionFactory,
-                PoolableInvocationWrapperPool requestPool) {
-            super(next, evicter, map, sessionFactory, requestPool);
-
-            Immoter immoterDelegate = super.getImmoter();
-            immoter = new InboundSessionTracker(immoterDelegate);
-
-            Emoter emoterDelegate = super.getEmoter();
-            emoter = new OutboundSessionTracker(emoterDelegate);
-        }
-
-        public Immoter getPromoter(Immoter immoter) {
-            Immoter delegate = super.getPromoter(immoter);
-            if (null == immoter) {
-                return new InboundSessionTracker(delegate);
-            } else {
-                return delegate;
-            }
-        }
-
-        public Immoter getImmoter() {
-            return immoter;
+        public void onSessionCreation(org.codehaus.wadi.core.session.Session session) {
         }
 
-        public Emoter getEmoter() {
-            return emoter;
-        }
-    }
-
-    private class OutboundSessionTracker implements Emoter {
-        private final Emoter delegate;
-
-        public OutboundSessionTracker(Emoter delegate) {
-            this.delegate = delegate;
+        public void onSessionDestruction(org.codehaus.wadi.core.session.Session session)
{
+            notifySessionDestruction(session);
         }
         
-        public boolean emote(Motable emotable, Motable immotable) {
-            notifyOutboundSessionMigration((WebSession) emotable);
-            return delegate.emote(emotable, immotable);
-        }
-    }
-
-    private class InboundSessionTracker implements Immoter {
-        private final Immoter delegate;
-
-        public InboundSessionTracker(Immoter delegate) {
-            this.delegate = delegate;
-            
-        }
-
-        public boolean immote(Motable emotable, Motable immotable) {
-            boolean success = delegate.immote(emotable, immotable);
-            if (success) {
-                notifyInboundSessionMigration((WebSession) immotable);
-            }
-            return success;
+        public void onInboundSessionMigration(org.codehaus.wadi.core.session.Session session)
{
+            notifyInboundSessionMigration(session);
         }
         
-        
-        public boolean contextualise(Invocation arg0, String arg1, Motable arg2) throws InvocationException
{
-            return delegate.contextualise(arg0, arg1, arg2);
-        }
-
-        public Motable newMotable() {
-            return delegate.newMotable();
-        }
-    }
-    
-    private class SessionListenerAdapter implements org.codehaus.wadi.SessionListener {
-
-        public void onSessionCreation(org.codehaus.wadi.Session session) {
-        }
-
-        public void onSessionDestruction(org.codehaus.wadi.Session session) {
-            notifySessionDestruction((WebSession) session);
+        public void onOutbountSessionMigration(org.codehaus.wadi.core.session.Session session)
{
+            notifyOutboundSessionMigration(session);
         }
         
     }

Modified: geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/WADISessionAdaptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/WADISessionAdaptor.java?view=diff&rev=514334&r1=514333&r2=514334
==============================================================================
--- geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/WADISessionAdaptor.java
(original)
+++ geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/WADISessionAdaptor.java
Sat Mar  3 18:21:20 2007
@@ -16,25 +16,19 @@
  */
 package org.apache.geronimo.clustering.wadi;
 
-import java.util.Collection;
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.geronimo.clustering.Session;
-import org.codehaus.wadi.web.WebSession;
 
 /**
  *
  * @version $Rev$ $Date$
  */
 public class WADISessionAdaptor implements Session {
-    private final WebSession session;
-    private final Map state;
+    private final org.codehaus.wadi.core.session.Session session;
     
-    public WADISessionAdaptor(WebSession session) {
+    public WADISessionAdaptor(org.codehaus.wadi.core.session.Session session) {
         this.session = session;
-        
-        state = new StateMap();
     }
 
     public String getSessionId() {
@@ -50,83 +44,23 @@
     }
 
     public Object addState(String key, Object value) {
-        return session.setAttribute(key, value);
+        return session.addState(key, value);
     }
 
     public Object getState(String key) {
-        return session.getAttribute(key);
+        return session.getState(key);
      }
 
     public Object removeState(String key) {
-        return session.removeAttribute(key);
+        return session.removeState(key);
     }
 
     public Map getState() {
-        return state;
+        return session.getState();
     }
     
     public void onEndAccess() {
         session.onEndProcessing();
     }
     
-    private class StateMap implements Map {
-
-        public Object put(Object key, Object value) {
-            String wadiKey = ensureTypeAndCast(key);
-            return addState(wadiKey, value);
-        }
-
-        public Object remove(Object key) {
-            String wadiKey = ensureTypeAndCast(key);
-            return removeState(wadiKey);
-        }
-
-        public void clear() {
-            throw new UnsupportedOperationException();
-        }
-
-        public boolean containsKey(Object key) {
-            throw new UnsupportedOperationException();
-        }
-
-        public boolean containsValue(Object value) {
-            throw new UnsupportedOperationException();
-        }
-
-        public Set entrySet() {
-            throw new UnsupportedOperationException();
-        }
-
-        public Object get(Object key) {
-            String wadiKey = ensureTypeAndCast(key);
-            return getState(wadiKey);
-        }
-
-        public boolean isEmpty() {
-            throw new UnsupportedOperationException();
-        }
-
-        public Set keySet() {
-            return session.getAttributeNameSet();
-        }
-
-        public void putAll(Map t) {
-            throw new UnsupportedOperationException();
-        }
-
-        public int size() {
-            return session.getAttributeNameSet().size();
-        }
-
-        public Collection values() {
-            throw new UnsupportedOperationException();
-        }
-
-        private String ensureTypeAndCast(Object key) {
-            if (!(key instanceof String)) {
-                throw new ClassCastException(String.class + " is expected.");
-            }
-            return (String) key;
-        }
-    }
 }

Modified: geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/WADISessionManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/WADISessionManager.java?view=diff&rev=514334&r1=514333&r2=514334
==============================================================================
--- geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/WADISessionManager.java
(original)
+++ geronimo/server/trunk/modules/geronimo-clustering-wadi/src/main/java/org/apache/geronimo/clustering/wadi/WADISessionManager.java
Sat Mar  3 18:21:20 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.geronimo.clustering.wadi;
 
-import org.codehaus.wadi.impl.ClusteredManager;
+import org.codehaus.wadi.core.manager.ClusteredManager;
 
 /**
  * 

Modified: geronimo/server/trunk/modules/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/wadi/WADIClusteredPreHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/wadi/WADIClusteredPreHandler.java?view=diff&rev=514334&r1=514333&r2=514334
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/wadi/WADIClusteredPreHandler.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/wadi/WADIClusteredPreHandler.java
Sat Mar  3 18:21:20 2007
@@ -28,8 +28,8 @@
 import org.apache.geronimo.clustering.ClusteredInvocation;
 import org.apache.geronimo.clustering.ClusteredInvocationException;
 import org.apache.geronimo.jetty6.cluster.AbstractClusteredPreHandler;
-import org.codehaus.wadi.InvocationException;
-import org.codehaus.wadi.impl.ClusteredManager;
+import org.codehaus.wadi.core.contextualiser.InvocationException;
+import org.codehaus.wadi.core.manager.ClusteredManager;
 import org.codehaus.wadi.web.impl.WebInvocation;
 
 

Modified: geronimo/server/trunk/modules/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/wadi/WADIClusteredPreHandlerFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/wadi/WADIClusteredPreHandlerFactory.java?view=diff&rev=514334&r1=514333&r2=514334
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/wadi/WADIClusteredPreHandlerFactory.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/wadi/WADIClusteredPreHandlerFactory.java
Sat Mar  3 18:21:20 2007
@@ -23,7 +23,7 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty6.PreHandler;
 import org.apache.geronimo.jetty6.PreHandlerFactory;
-import org.codehaus.wadi.impl.ClusteredManager;
+import org.codehaus.wadi.core.manager.ClusteredManager;
 
 
 /**

Modified: geronimo/server/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/pom.xml?view=diff&rev=514334&r1=514333&r2=514334
==============================================================================
--- geronimo/server/trunk/pom.xml (original)
+++ geronimo/server/trunk/pom.xml Sat Mar  3 18:21:20 2007
@@ -966,12 +966,6 @@
             </dependency>
 
             <dependency>
-                <groupId>org.apache.catalina.tribes</groupId>
-                <artifactId>tribes</artifactId>
-                <version>0.9.5.2</version>
-            </dependency>
-
-            <dependency>
                 <groupId>org.mortbay.jetty</groupId>
                 <artifactId>jetty</artifactId>
                 <version>6.1.0</version>



Mime
View raw message