Author: fmeschbe
Date: Thu Dec  3 23:55:32 2009
New Revision: 886997

URL: http://svn.apache.org/viewvc?rev=886997&view=rev
Log:
FELIX-1179 Apply modified patch by Justin Edelson (thanks) to replace Eclipse 
Servlet Bridge by new Apache Felix Servlet bridge. Also updated and fixed the 
LICENSE and NOTICE files and removed API packages from the artifacts, which are 
either provided by the servlet container (Servlet API) or by the Bridge bundle 
(OSGi Http Service).

Removed:
    sling/trunk/launchpad/base/src/main/appended-resources/META-INF/LICENSE
    sling/trunk/launchpad/base/src/main/webapp/WEB-INF/LICENSE
    sling/trunk/launchpad/base/src/main/webapp/WEB-INF/NOTICE
Modified:
    sling/trunk/launchpad/base/pom.xml
    sling/trunk/launchpad/base/src/main/appended-resources/META-INF/NOTICE
    
sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingBridge.java
    
sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServletDelegate.java
    sling/trunk/launchpad/base/src/main/resources/sling.properties

Modified: sling/trunk/launchpad/base/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/base/pom.xml?rev=886997&r1=886996&r2=886997&view=diff
==============================================================================
--- sling/trunk/launchpad/base/pom.xml (original)
+++ sling/trunk/launchpad/base/pom.xml Thu Dec  3 23:55:32 2009
@@ -37,6 +37,10 @@
         by the various launchpad modules..
     </description>
 
+    <properties>
+        <felix.httpservice.version>2.0.4</felix.httpservice.version>
+    </properties>
+
     <scm>
         
<connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/launchpad/base</connection>
         
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/launchpad/base</developerConnection>
@@ -72,9 +76,7 @@
                         <DynamicImport-Package>*</DynamicImport-Package>
                         <Embed-Dependency>
                             
org.apache.felix.framework;inline=org/**|META-INF/**,
-                            
org.osgi.compendium;inline=org/osgi/service/http/**,
-                            servlet-api;inline=javax/servlet/**,
-                            servlet;inline=org/eclipse/**
+                            org.apache.felix.http.proxy;inline=org/apache/**
                         </Embed-Dependency>
                     </instructions>
                 </configuration>
@@ -181,9 +183,9 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.eclipse.equinox.http</groupId>
-            <artifactId>servlet</artifactId>
-            <version>1.0.0-v20070606</version>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.http.proxy</artifactId>
+            <version>${felix.httpservice.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

Modified: sling/trunk/launchpad/base/src/main/appended-resources/META-INF/NOTICE
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/appended-resources/META-INF/NOTICE?rev=886997&r1=886996&r2=886997&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/appended-resources/META-INF/NOTICE 
(original)
+++ sling/trunk/launchpad/base/src/main/appended-resources/META-INF/NOTICE Thu 
Dec  3 23:55:32 2009
@@ -5,7 +5,3 @@
 The OSGi Alliance (http://www.osgi.org/).
 Copyright (c) OSGi Alliance (2000, 2009).
 Licensed under the Apache License 2.0.
-
-This product includes software developed at
-The Eclipse Foundation (http://www.eclipse.org/).
-Licensed under the Eclipse Public License 1.0

Modified: 
sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingBridge.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingBridge.java?rev=886997&r1=886996&r2=886997&view=diff
==============================================================================
--- 
sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingBridge.java
 (original)
+++ 
sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingBridge.java
 Thu Dec  3 23:55:32 2009
@@ -18,12 +18,13 @@
 
 import java.util.Map;
 
+import javax.servlet.ServletContext;
+
 import org.apache.felix.framework.Logger;
 import org.apache.sling.launchpad.base.impl.ResourceProvider;
 import org.apache.sling.launchpad.base.impl.Sling;
 import org.apache.sling.launchpad.base.shared.Notifiable;
-import org.eclipse.equinox.http.servlet.internal.Activator;
-import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
 
 /**
@@ -33,32 +34,12 @@
  */
 public class SlingBridge extends Sling {
 
-    // The Equinox Http Service activator
-    private BundleActivator httpServiceActivator;
-
     public SlingBridge(Notifiable notifiable, Logger logger,
-            ResourceProvider resourceProvider, Map<String, String> 
propOverwrite)
+            ResourceProvider resourceProvider, Map<String, String> 
propOverwrite,
+            ServletContext servletContext)
             throws BundleException {
         super(notifiable, logger, resourceProvider, propOverwrite);
-    }
-
-    @Override
-    protected void doStartBundle() throws Exception {
-        // activate the HttpService
-        this.httpServiceActivator = new Activator();
-        this.httpServiceActivator.start(this.getBundleContext());
-    }
-
-    @Override
-    protected void doStopBundle() {
-        if (this.httpServiceActivator != null) {
-            try {
-                this.httpServiceActivator.stop(this.getBundleContext());
-            } catch (Exception e) {
-                logger.log(Logger.LOG_ERROR,
-                    "Unexpected problem stopping HttpService", e);
-            }
-            this.httpServiceActivator = null;
-        }
+        
+        servletContext.setAttribute(BundleContext.class.getName(), 
getBundleContext());
     }
 }

Modified: 
sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServletDelegate.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServletDelegate.java?rev=886997&r1=886996&r2=886997&view=diff
==============================================================================
--- 
sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServletDelegate.java
 (original)
+++ 
sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/webapp/SlingServletDelegate.java
 Thu Dec  3 23:55:32 2009
@@ -37,13 +37,13 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.felix.framework.Logger;
+import org.apache.felix.http.proxy.ProxyServlet;
 import org.apache.sling.launchpad.base.impl.ClassLoaderResourceProvider;
 import org.apache.sling.launchpad.base.impl.ResourceProvider;
 import org.apache.sling.launchpad.base.impl.Sling;
 import org.apache.sling.launchpad.base.shared.Launcher;
 import org.apache.sling.launchpad.base.shared.Notifiable;
 import org.apache.sling.launchpad.base.shared.SharedConstants;
-import org.eclipse.equinox.http.servlet.HttpServiceServlet;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceReference;
@@ -199,10 +199,10 @@
             Logger logger = new ServletContextLogger(getServletContext());
             ResourceProvider rp = new ServletContextResourceProvider(
                 getServletContext());
-            tmpSling = new SlingBridge(notifiable, logger, rp, props);
+            tmpSling = new SlingBridge(notifiable, logger, rp, props, 
getServletContext());
 
             // set up the OSGi HttpService proxy servlet
-            tmpDelegatee = new HttpServiceServlet();
+            tmpDelegatee = new ProxyServlet();
             tmpDelegatee.init(getServletConfig());
 
             // set the fields only if the SlingServletDelegate has no been 
destroyed

Modified: sling/trunk/launchpad/base/src/main/resources/sling.properties
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/resources/sling.properties?rev=886997&r1=886996&r2=886997&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/resources/sling.properties (original)
+++ sling/trunk/launchpad/base/src/main/resources/sling.properties Thu Dec  3 
23:55:32 2009
@@ -201,8 +201,6 @@
  org.osgi.service.startlevel; version=1.1, \
  org.osgi.service.url; version=1.0
 
-# Only provide the HTTP Service (embedded for the webapp) and the tracker
-# (from the felix framework)
+# Only provide the tracker (from the felix framework) 
 sling.osgi-compendium-services= \
- org.osgi.service.http;version="1.2.1", \
  org.osgi.util.tracker;version="1.4"
\ No newline at end of file


Reply via email to