felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1057096 - in /felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal: JettyActivator.java JettyService.java
Date Mon, 10 Jan 2011 07:29:17 GMT
Author: fmeschbe
Date: Mon Jan 10 07:29:16 2011
New Revision: 1057096

URL: http://svn.apache.org/viewvc?rev=1057096&view=rev
Log:
FELIX-1962 Add the EventDispatcher from the Http Base bundle as listener into Jetty to allow
Jetty to send events to the registered listener services

Modified:
    felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyActivator.java
    felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java

Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyActivator.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyActivator.java?rev=1057096&r1=1057095&r2=1057096&view=diff
==============================================================================
--- felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyActivator.java
(original)
+++ felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyActivator.java
Mon Jan 10 07:29:16 2011
@@ -19,7 +19,7 @@ package org.apache.felix.http.jetty.inte
 import org.apache.felix.http.base.internal.AbstractHttpActivator;
 
 public final class JettyActivator
-    extends AbstractHttpActivator 
+    extends AbstractHttpActivator
 {
     private JettyService jetty;
 
@@ -27,7 +27,8 @@ public final class JettyActivator
         throws Exception
     {
         super.doStart();
-        this.jetty = new JettyService(getBundleContext(), getDispatcherServlet(), getHttpServiceController());
+        this.jetty = new JettyService(getBundleContext(), getDispatcherServlet(), getEventDispatcher(),
+            getHttpServiceController());
         this.jetty.start();
     }
 

Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java?rev=1057096&r1=1057095&r2=1057096&view=diff
==============================================================================
--- felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java
(original)
+++ felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java
Mon Jan 10 07:29:16 2011
@@ -28,6 +28,7 @@ import org.mortbay.jetty.bio.SocketConne
 import org.mortbay.jetty.nio.SelectChannelConnector;
 import org.mortbay.jetty.servlet.*;
 import org.apache.felix.http.base.internal.DispatcherServlet;
+import org.apache.felix.http.base.internal.EventDispatcher;
 import org.apache.felix.http.base.internal.HttpServiceController;
 import org.apache.felix.http.base.internal.logger.SystemLogger;
 
@@ -48,13 +49,16 @@ public final class JettyService
     private ServiceRegistration configServiceReg;
     private Server server;
     private DispatcherServlet dispatcher;
+    private EventDispatcher eventDispatcher;
     private final HttpServiceController controller;
 
-    public JettyService(BundleContext context, DispatcherServlet dispatcher, HttpServiceController
controller)
+    public JettyService(BundleContext context, DispatcherServlet dispatcher, EventDispatcher
eventDispatcher,
+        HttpServiceController controller)
     {
         this.context = context;
         this.config = new JettyConfig(this.context);
         this.dispatcher = dispatcher;
+        this.eventDispatcher = eventDispatcher;
         this.controller = controller;
     }
 
@@ -153,6 +157,8 @@ public final class JettyService
             }
 
             Context context = new Context(this.server, "/", Context.SESSIONS);
+            context.addEventListener(eventDispatcher);
+            context.getSessionHandler().addEventListener(eventDispatcher);
             context.addServlet(new ServletHolder(this.dispatcher), "/*");
 
             this.server.start();



Mime
View raw message