diff --git a/http.jetty/LICENSE b/http.jetty/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/http.jetty/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
diff --git a/http.jetty/NOTICE b/http.jetty/NOTICE
deleted file mode 100644
index a300b7f..0000000
--- a/http.jetty/NOTICE
+++ /dev/null
@@ -1,27 +0,0 @@
-Apache Felix Jetty HTTP Service
-Copyright 2008-2009 The Apache Software Foundation
-
-I. Included Software
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software developed by
-Mortbay (http://mortbay.org)
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-The OSGi Alliance (http://www.osgi.org/).
-Copyright (c) OSGi Alliance (2000, 2007).
-Licensed under the Apache License 2.0.
-
-II. Used Software
-
-This product uses software developed at
-The OSGi Alliance (http://www.osgi.org).
-Copyright (c) OSGi Alliance (2000, 2007).
-Licensed under the Apache License 2.0.
-
-III. License Summary
-- Apache License 2.0
\ No newline at end of file
diff --git a/http.jetty/doc/changelog.txt b/http.jetty/doc/changelog.txt
deleted file mode 100644
index ca469e6..0000000
--- a/http.jetty/doc/changelog.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Version 1.0.1
--------------
-    * [FELIX-1236] Jetty HTTP service is exporting incorrect version of the
-      service package.
-
-Version 1.0.0
--------------
-    * Initial release 
diff --git a/http.jetty/pom.xml b/http.jetty/pom.xml
deleted file mode 100644
index 1066ac2..0000000
--- a/http.jetty/pom.xml
+++ /dev/null
@@ -1,134 +0,0 @@
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-    http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <parent>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>felix-parent</artifactId>
-      <version>1.2.0</version>
-      <relativePath>../../pom/pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <packaging>bundle</packaging>
-    <name>Apache Felix HTTP Service Jetty</name>
-    <version>1.1.1-SNAPSHOT</version>
-    <artifactId>org.apache.felix.http.jetty</artifactId>
-    <dependencies>
-        <dependency>
-            <groupId>${pom.groupId}</groupId>
-            <artifactId>org.osgi.core</artifactId>
-            <version>1.0.0</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>${pom.groupId}</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-            <version>1.0.0</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>${pom.groupId}</groupId>
-                    <artifactId>javax.servlet</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <!--
-        <dependency>
-            <groupId>org.mortbay.jetty</groupId>
-            <artifactId>servlet-api-2.5</artifactId>
-            <version>6.1.14</version>
-        </dependency>
-        -->
-        <dependency>
-            <groupId>org.mortbay.jetty</groupId>
-            <artifactId>jetty</artifactId>
-            <version>6.1.24</version>
-        </dependency>
-        <dependency>
-            <groupId>org.mortbay.jetty</groupId>
-            <artifactId>jetty-util</artifactId>
-            <version>6.1.24</version>
-        </dependency>
-        <dependency>
-            <groupId>org.mortbay.jetty</groupId>
-            <artifactId>jetty-sslengine</artifactId>
-            <version>6.1.24</version>
-        </dependency>
-    </dependencies>
-    <build>
-        <plugins>
-			<plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Bundle-Name>Apache Felix HTTP Service Jetty</Bundle-Name>
-                        <Bundle-Description>
-                            An implementation of the OSGi HTTP Service
-                            using Jetty.
-                        </Bundle-Description>
-                        <Bundle-Activator>
-                            ${pom.artifactId}.Activator
-                        </Bundle-Activator>
-                        <Bundle-SymbolicName>
-                            ${pom.artifactId}
-                        </Bundle-SymbolicName>
-                        <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
-                        <Export-Package>
-                            org.osgi.service.http,
-                            javax.servlet;javax.servlet.http;version=2.5
-                        </Export-Package>
-                        <Private-Package>
-                            org.apache.felix.http.jetty,
-                            org.mortbay.*;-split-package:=merge-first
-                        </Private-Package>
-                        <Import-Package>
-                            javax.net.ssl; javax.security.cert;
-                            javax.xml.parsers; org.xml.sax;
-                            org.xml.sax.helpers;
-                            org.slf4j;resolution:=optional, *
-                        </Import-Package>
-                        <Export-Service>
-                            org.osgi.service.http.HttpService
-                        </Export-Service>
-                        <Include-Resource> 
-                        	META-INF/LICENCE=LICENSE,
-							META-INF/NOTICE=NOTICE 
-						</Include-Resource>
-                    </instructions>
-                </configuration>
-            </plugin>
-            <plugin>
-				<groupId>org.codehaus.mojo</groupId>
-				<artifactId>rat-maven-plugin</artifactId>
-				<configuration>
-					<excludeSubProjects>false</excludeSubProjects>
-					<useEclipseDefaultExcludes>true</useEclipseDefaultExcludes>
-					<useMavenDefaultExcludes>true</useMavenDefaultExcludes>
-					<excludes>
-						<param>doc/*</param>
-						<param>maven-eclipse.xml</param>
-						<param>.checkstyle</param>
-						<param>.externalToolBuilders/*</param>
-					</excludes>
-				</configuration>
-			</plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/http.jetty/src/main/java/org/apache/felix/http/jetty/Activator.java b/http.jetty/src/main/java/org/apache/felix/http/jetty/Activator.java
deleted file mode 100644
index 91bf091..0000000
--- a/http.jetty/src/main/java/org/apache/felix/http/jetty/Activator.java
+++ /dev/null
@@ -1,566 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.http.jetty;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.mortbay.component.LifeCycle;
-import org.mortbay.jetty.Connector;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.bio.SocketConnector;
-import org.mortbay.jetty.nio.SelectChannelConnector;
-import org.mortbay.jetty.security.HashUserRealm;
-import org.mortbay.jetty.security.SslSocketConnector;
-import org.mortbay.jetty.servlet.Context;
-import org.mortbay.jetty.servlet.OsgiServletHandler;
-import org.mortbay.jetty.servlet.SessionHandler;
-import org.mortbay.log.Log;
-import org.mortbay.log.StdErrLog;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceFactory;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.cm.ConfigurationException;
-import org.osgi.service.cm.ManagedService;
-import org.osgi.service.http.HttpService;
-import org.osgi.service.log.LogService;
-import org.osgi.util.tracker.ServiceTracker;
-
-
-/**
- *  Basic implementation of OSGi HTTP service 1.1.
- *
- *  TODO:
- *
- *      - fuller suite of testing and compatibility tests
- *
- *      - only exposed params are those defined in the OSGi spec. Jetty is
- *        very tunable via params, some of which it may be useful to expose
- *
- *      - no cacheing is performed on delivered resources. Although not part
- *        of the OSGi spec, it also isn't precluded and would enhance
- *        performance in a high usage environment. Jetty's ResourceHandler
- *        class could be a model for this.
- *
- *      - scanning the Jetty ResourceHandler class it's clear that there are
- *        many other sophisticated areas to do with resource handling such
- *        as checking date and range fields in the http headers. It's not clear
- *        whether any of these play a part in the OSGi service - the spec
- *        just describes "returning the contents of the URL to the client" which
- *        doesn't state what other HTTP handling might be compliant or desirable
- */
-public class Activator implements BundleActivator, ManagedService, Runnable {
-    private static final Properties EMPTY_PROPS = new Properties();
-    
-    public static final boolean DEFAULT_HTTP_ENABLE = true;
-    public static final boolean DEFAULT_HTTPS_ENABLE = false;
-    public static final boolean DEFAULT_USE_NIO = true;
-    public static final int DEFAULT_HTTPS_PORT = 443;
-    public static final int DEFAULT_HTTP_PORT = 80;
-    public static final String DEFAULT_SSL_PROVIDER = "org.mortbay.http.SunJsseListener";
-    public static final String DEFAULT_HTTPS_CLIENT_CERT = "none";
-    
-    /** Felix specific property to override the SSL provider. */
-    public static final String FELIX_SSL_PROVIDER = "org.apache.felix.https.provider";
-    public static final String OSCAR_SSL_PROVIDER = "org.ungoverned.osgi.bundle.https.provider";
-    
-    /** Felix specific property to override the keystore key password. */
-    public static final String FELIX_KEYSTORE_KEY_PASSWORD = "org.apache.felix.https.keystore.key.password";
-    public static final String OSCAR_KEYSTORE_KEY_PASSWORD = "org.ungoverned.osgi.bundle.https.key.password";
-    
-    /** Felix specific property to override the keystore file location. */
-    public static final String FELIX_KEYSTORE = "org.apache.felix.https.keystore";
-    public static final String OSCAR_KEYSTORE = "org.ungoverned.osgi.bundle.https.keystore";
-    
-    /** Felix specific property to override the keystore password. */
-    public static final String FELIX_KEYSTORE_PASSWORD = "org.apache.felix.https.keystore.password";
-    public static final String OSCAR_KEYSTORE_PASSWORD = "org.ungoverned.osgi.bundle.https.password";
-
-    /** Standard OSGi port property for HTTP service */
-    public static final String  HTTP_PORT    = "org.osgi.service.http.port";
-    
-    /** Standard OSGi port property for HTTPS service */
-    public static final String  HTTPS_PORT   = "org.osgi.service.http.port.secure";
-    
-    /** Felix specific property to enable debug messages */
-    public static final String FELIX_HTTP_DEBUG = "org.apache.felix.http.debug";
-    public static final String  HTTP_DEBUG   = "org.apache.felix.http.jetty.debug";
-
-    /** Felix specific property to determine the
-        name of the service property to set with the http port used. If not supplied
-        then the HTTP_PORT property name will be used for the service property */
-    public static final String  HTTP_SVCPROP_PORT    = "org.apache.felix.http.svcprop.port";
-    
-    /** Felix specific property to determine the
-        name of the service property to set with the https port used. If not supplied
-        then the HTTPS_PORT property name will be used for the service property */
-    public static final String  HTTPS_SVCPROP_PORT   = "org.apache.felix.http.svcprop.port.secure";
-
-    /** Felix specific property to control whether NIO will be used. If not supplied
-        then will default to true. */
-    public static final String  HTTP_NIO             = "org.apache.felix.http.nio";
-    
-    /** Felix specific property to control whether to enable HTTPS. */
-    public static final String FELIX_HTTPS_ENABLE = "org.apache.felix.https.enable";
-    public static final String  OSCAR_HTTPS_ENABLE   = "org.ungoverned.osgi.bundle.https.enable";
-    
-    /** Felix specific property to control whether to enable HTTP. */
-    public static final String FELIX_HTTP_ENABLE = "org.apache.felix.http.enable";
-    
-    /** Felix specific property to control whether to want or require HTTPS client certificates. Valid values are "none", "wants", "needs". Default is "none". */
-    public static final String FELIX_HTTPS_CLIENT_CERT = "org.apache.felix.https.clientcertificate";
-
-    /** Felix specific property to override the truststore file location. */
-    public static final String FELIX_TRUSTSTORE = "org.apache.felix.https.truststore";
-    
-    /** Felix specific property to override the truststore password. */
-    public static final String FELIX_TRUSTSTORE_PASSWORD = "org.apache.felix.https.truststore.password";
-    
-    /** PID for configuration of the HTTP service. */
-    protected static final String PID = "org.apache.felix.http";
-    
-    protected static boolean debug = false;
-    private static ServiceTracker m_logTracker = null;
-
-    private BundleContext m_bundleContext = null;
-    private ServiceRegistration m_svcReg = null;
-    private HttpServiceFactory m_httpServ = null;
-    private Server m_server = null;
-    private OsgiServletHandler m_hdlr = null;
-
-    private int m_httpPort;
-    private int m_httpsPort;
-    private boolean m_useNIO;
-    private String m_sslProvider;
-    private String m_httpsPortProperty;
-    private String m_keystore;
-    private String m_passwd;
-    private String m_keyPasswd;
-    private boolean m_useHttps;
-    private String m_httpPortProperty;
-    private String m_truststore;
-    private String m_trustpasswd;
-
-    private Properties m_svcProperties = new Properties();
-    private boolean m_useHttp;
-    private String m_clientcert;
-    private ServiceRegistration m_configSvcReg;
-    private volatile boolean m_running;
-    private volatile Thread m_thread;
-
-    public void start(BundleContext bundleContext) throws BundleException {
-        m_bundleContext = bundleContext;
-
-        m_logTracker = new ServiceTracker( bundleContext, LogService.class.getName(), null );
-        m_logTracker.open();
-
-        setConfiguration(EMPTY_PROPS);
-        
-        m_running = true;
-        m_thread = new Thread(this, "Jetty HTTP Service Launcher");
-        m_thread.start();
-        
-        m_configSvcReg = m_bundleContext.registerService(ManagedService.class.getName(), this, new Properties() {{ put(Constants.SERVICE_PID, PID); }} );
-    }
-    
-    public void stop(BundleContext bundleContext) throws BundleException {
-        if (m_configSvcReg != null) {
-            m_configSvcReg.unregister();
-        }
-        
-        m_running = false;
-        m_thread.interrupt();
-        try {
-            m_thread.join(3000);
-        }
-        catch (InterruptedException e) {
-            // not much we can do here
-        }
-        
-        m_logTracker.close();
-    }
-    
-    private void startJetty() {
-        try {
-            initializeJetty();
-        }
-        catch (Exception ex) {
-            log(LogService.LOG_ERROR, "Exception while initializing Jetty.", ex);
-            return;
-        }
-
-        m_httpServ = new HttpServiceFactory();
-        m_svcReg = m_bundleContext.registerService( HttpService.class.getName(), m_httpServ, m_svcProperties );
-        // OSGi spec states the properties should not be changed after registration,
-        // so create new copy for later  clone for updates
-        m_svcProperties = new Properties(m_svcProperties);
-    }
-
-    private void stopJetty() {
-        if (m_svcReg != null) {
-            m_svcReg.unregister();
-            // null the registration, because the listener assumes a non-null registration is valid
-            m_svcReg = null;
-        }
-
-        try {
-            m_server.stop();
-        }
-        catch (Exception e) {
-            log(LogService.LOG_ERROR, "Exception while stopping Jetty.", e);
-        }
-    }
-
-    /**
-     * The main loop for running Jetty. We run Jetty in its own thread now because we need to
-     * modify this thread's context classloader. The main loop starts Jetty and then waits until
-     * it is interrupted. Then it stops Jetty, and either quits or restarts (depending on the
-     * reason why the thread was interrupted, because the bundle was stopped or the configuration
-     * was updated).
-     */
-    public void run() {
-        // org.mortbay.util.Loader needs this (used for JDK 1.4 log classes)
-        Thread.currentThread().setContextClassLoader( this.getClass().getClassLoader() );
-        
-        while (m_running) {
-            // start jetty
-            initializeJettyLogger();
-            startJetty();
-            
-            // wait
-            synchronized (this) {
-                try {
-                    wait();
-                }
-                catch (InterruptedException e) {
-                    // we will definitely be interrupted
-                }
-            }
-            
-            // stop jetty
-            stopJetty();
-            destroyJettyLogger();
-        }
-    }
-    
-    
-    public void updated(Dictionary props) throws ConfigurationException {
-        if (props == null) {
-            // fall back to default configuration
-            setConfiguration(EMPTY_PROPS);
-        }
-        else {
-            // let's see what we've got
-            setConfiguration(props);
-        }
-        // notify the thread that the configuration was updated, causing Jetty to
-        // restart
-        if (m_thread != null) {
-            m_thread.interrupt();
-        }
-    }
-    
-    private void setConfiguration(Dictionary props) {
-        debug = getBooleanProperty(props, FELIX_HTTP_DEBUG, getBooleanProperty(props, HTTP_DEBUG, false));
-        
-        // get default HTTP and HTTPS ports as per the OSGi spec
-        m_httpPort = getIntProperty(props, HTTP_PORT, DEFAULT_HTTP_PORT);
-        m_httpsPort = getIntProperty(props, HTTPS_PORT, DEFAULT_HTTPS_PORT);
-        // collect other properties, default to legacy names only if new ones are not available
-        m_useNIO = getBooleanProperty(props, HTTP_NIO, DEFAULT_USE_NIO);
-        m_sslProvider = getStringProperty(props, FELIX_SSL_PROVIDER, getStringProperty(props, OSCAR_SSL_PROVIDER, DEFAULT_SSL_PROVIDER));
-        m_httpsPortProperty = getStringProperty(props, HTTPS_SVCPROP_PORT, HTTPS_PORT);
-        m_keystore = getStringProperty(props, FELIX_KEYSTORE, m_bundleContext.getProperty(OSCAR_KEYSTORE));
-        m_passwd = getStringProperty(props, FELIX_KEYSTORE_PASSWORD, m_bundleContext.getProperty(OSCAR_KEYSTORE_PASSWORD));
-        m_keyPasswd = getStringProperty(props, FELIX_KEYSTORE_KEY_PASSWORD, m_bundleContext.getProperty(OSCAR_KEYSTORE_KEY_PASSWORD));
-        m_useHttps = getBooleanProperty(props, FELIX_HTTPS_ENABLE, getBooleanProperty(props, OSCAR_HTTPS_ENABLE, DEFAULT_HTTPS_ENABLE));
-        m_httpPortProperty = getStringProperty(props, HTTP_SVCPROP_PORT, HTTP_PORT);
-        m_useHttp = getBooleanProperty(props, FELIX_HTTP_ENABLE, DEFAULT_HTTP_ENABLE);
-        m_truststore = getStringProperty(props, FELIX_TRUSTSTORE, null);
-        m_trustpasswd = getStringProperty(props, FELIX_TRUSTSTORE_PASSWORD, null);
-        m_clientcert = getStringProperty(props, FELIX_HTTPS_CLIENT_CERT, DEFAULT_HTTPS_CLIENT_CERT);
-    }
-
-    private String getProperty(Dictionary props, String name) {
-        String result = (String) props.get(name);
-        if (result == null) {
-            result = m_bundleContext.getProperty(name);
-        }
-        return result;
-    }
-    
-    private int getIntProperty(Dictionary props, String name, int dflt_val) {
-        int retval = dflt_val;
-        try {
-            retval = Integer.parseInt(getProperty(props, name));
-        }
-        catch (Exception e) {
-            retval = dflt_val;
-        }
-        return retval;
-    }
-        
-    private boolean getBooleanProperty(Dictionary props, String name, boolean dflt_val) {
-        boolean retval = dflt_val;
-        String strval = getProperty(props, name);
-        if (strval != null) {
-            retval = (strval.toLowerCase().equals("true") || strval.toLowerCase().equals("yes"));
-        }
-        return retval;
-    }
-   
-    private String getStringProperty(Dictionary props, String name, String dflt_val) {
-        String retval = dflt_val;
-        String strval = getProperty(props, name);
-        if (strval != null) {
-            retval = strval;
-        }
-        return retval;
-    }
-
-    protected void initializeJettyLogger() {
-        String oldProperty = System.getProperty( "org.mortbay.log.class" );
-        System.setProperty( "org.mortbay.log.class", LogServiceLog.class.getName() );
-        
-        if (!(Log.getLog() instanceof LogServiceLog)) {
-            Log.setLog( new LogServiceLog() );
-        }
-        
-        Log.getLog().setDebugEnabled( debug );
-        
-        if (oldProperty != null) {
-            System.setProperty( "org.mortbay.log.class", oldProperty );
-        }
-    }
-    
-    private void destroyJettyLogger() {
-        // replace non-LogService logger for jetty
-        Log.setLog( new StdErrLog() );
-    }
-    
-    protected void initializeJetty() throws Exception
-    {
-        //TODO: Maybe create a separate "JettyServer" object here?
-        // Realm
-        HashUserRealm realm = new HashUserRealm( "OSGi HTTP Service Realm" );
-
-        // Create server
-        m_server = new Server();
-        m_server.addUserRealm( realm );
-
-        if (m_useHttp)
-        {
-            initializeHTTP();
-        }
-
-        if (m_useHttps)
-        {
-            initializeHTTPS();
-        }
-
-        // setup the Jetty web application context shared by all Http services
-        m_hdlr = new OsgiServletHandler();
-
-        Context hdlrContext = new Context( m_server, new SessionHandler(), null, m_hdlr, null );
-        hdlrContext.setClassLoader( getClass().getClassLoader() );
-        hdlrContext.setContextPath( "/" );
-        debug( " adding handler context : " + hdlrContext );
-
-        try
-        {
-            hdlrContext.start();
-        }
-        catch ( Exception e )
-        {
-            // make sure we unwind the adding process
-            log( LogService.LOG_ERROR, "Exception Starting Jetty Handler Context", e );
-        }
-
-        m_server.start();
-    }
-
-    private void initializeHTTP() {
-        Connector connector = m_useNIO ? 
-                              (Connector) new SelectChannelConnector() : (Connector) new SocketConnector();
-        connector.addLifeCycleListener(
-                new ConnectorListener(m_httpPortProperty)
-            );
-        
-        connector.setPort( m_httpPort );
-        connector.setMaxIdleTime( 60000 );
-        m_server.addConnector( connector );
-    }
-
-    //TODO: Just a basic implementation to give us a working HTTPS port. A better
-    //      long-term solution may be to separate out the SSL provider handling,
-    //      keystore, passwords etc. into it's own pluggable service
-    protected void initializeHTTPS() throws Exception
-    {
-        if (m_useNIO) {
-            SelectChannelConnector s_listener = (SelectChannelConnector) Class.forName("org.mortbay.jetty.security.SslSelectChannelConnector").newInstance();
-            s_listener.addLifeCycleListener(new ConnectorListener(m_httpsPortProperty));
-            s_listener.setPort(m_httpsPort);
-            s_listener.setMaxIdleTime(60000);
-            if (m_keystore != null) {
-                s_listener.getClass().getMethod("setKeystore", new Class[] {String.class}).invoke(s_listener, new Object[] { m_keystore });
-            }
-            if (m_passwd != null) {
-                System.setProperty("jetty.ssl.password" /* SslSelectChannelConnector.PASSWORD_PROPERTY */ , m_passwd);
-                s_listener.getClass().getMethod("setPassword", new Class[] {String.class}).invoke(s_listener, new Object[] { m_passwd });
-            }
-            if (m_keyPasswd != null) {
-                System.setProperty("jetty.ssl.keypassword" /* SslSelectChannelConnector.KEYPASSWORD_PROPERTY */, m_keyPasswd);
-                s_listener.getClass().getMethod("setKeyPassword", new Class[] {String.class}).invoke(s_listener, new Object[] { m_keyPasswd });
-            }
-            if (m_truststore != null) {
-                s_listener.getClass().getMethod("setTruststore", new Class[] {String.class}).invoke(s_listener, new Object[] { m_truststore });
-            }
-            if (m_trustpasswd != null) {
-                s_listener.getClass().getMethod("setTrustPassword", new Class[] {String.class}).invoke(s_listener, new Object[] { m_trustpasswd });
-            }
-            if ("wants".equals(m_clientcert)) {
-                s_listener.getClass().getMethod("setWantClientAuth", new Class[] { Boolean.TYPE }).invoke(s_listener, new Object[] { Boolean.TRUE });
-            }
-            else if ("needs".equals(m_clientcert)) {
-                s_listener.getClass().getMethod("setNeedClientAuth", new Class[] { Boolean.TYPE }).invoke(s_listener, new Object[] { Boolean.TRUE });
-            }
-            m_server.addConnector(s_listener);
-        }
-        else {
-            SslSocketConnector s_listener = new SslSocketConnector();
-            s_listener.addLifeCycleListener(new ConnectorListener(m_httpsPortProperty));
-            s_listener.setPort(m_httpsPort);
-            s_listener.setMaxIdleTime(60000);
-            if (m_keystore != null) {
-                s_listener.setKeystore(m_keystore);
-            }
-            if (m_passwd != null) {
-                System.setProperty(SslSocketConnector.PASSWORD_PROPERTY, m_passwd);
-                s_listener.setPassword(m_passwd);
-            }
-            if (m_keyPasswd != null) {
-                System.setProperty(SslSocketConnector.KEYPASSWORD_PROPERTY, m_keyPasswd);
-                s_listener.setKeyPassword(m_keyPasswd);
-            }
-            if (m_truststore != null) {
-                s_listener.setTruststore(m_truststore);
-            }
-            if (m_trustpasswd != null) {
-                s_listener.setTrustPassword(m_trustpasswd);
-            }
-            if ("wants".equals(m_clientcert)) {
-                s_listener.setWantClientAuth(true);
-                s_listener.getClass().getMethod("setWantClientAuth", new Class[] {Boolean.class}).invoke(s_listener, new Object[] { Boolean.TRUE });
-            }
-            else if ("needs".equals(m_clientcert)) {
-                s_listener.setNeedClientAuth(true);
-            }
-            m_server.addConnector(s_listener);
-        }
-    }
-
-    public static void debug( String txt )
-    {
-        if ( debug )
-        {
-            log( LogService.LOG_DEBUG, ">>Felix HTTP: " + txt, null );
-        }
-    }
-
-    public static void log( int level, String message, Throwable throwable )
-    {
-        LogService log = ( LogService ) m_logTracker.getService();
-        if ( log != null )
-        {
-            log.log( level, message, throwable );
-        }
-        else
-        {
-            System.out.println( message );
-            if ( throwable != null )
-            {
-                throwable.printStackTrace( System.out );
-            }
-        }
-    }
-
-    // Inner class to provide basic service factory functionality
-    public class HttpServiceFactory implements ServiceFactory
-    {
-        public HttpServiceFactory()
-        {
-            // Initialize the statics for the service implementation.
-            HttpServiceImpl.initializeStatics();
-        }
-
-        public Object getService( Bundle bundle, ServiceRegistration registration )
-        {
-            Object srv = new HttpServiceImpl( bundle, m_server, m_hdlr );
-            debug( "** http service get:" + bundle + ", service: " + srv );
-            return srv;
-        }
-
-        public void ungetService( Bundle bundle, ServiceRegistration registration, Object service )
-        {
-            debug( "** http service unget:" + bundle + ", service: " + service );
-            ( ( HttpServiceImpl ) service ).unregisterAll();
-        }
-    }
-    
-    // Innner class to listen for connector startup and register service
-    // properties for actual ports used. Possible connections may have deferred
-    // startup, so this should ensure "port" is retrieved once available
-    public class ConnectorListener implements LifeCycle.Listener
-    {
-        String m_svcPropName;
-        
-        public ConnectorListener(String svcPropName)
-        {
-            m_svcPropName = svcPropName;
-        }
-        
-        public void lifeCycleFailure(LifeCycle event, Throwable cause) {}
-           
-        public void lifeCycleStarted(LifeCycle event)
-        {
-            Connector conn = (Connector) event;
-            int actualPort = conn.getLocalPort();
-            
-            debug( "** http set service prop:" + m_svcPropName + ", value: " + actualPort );
-            
-            m_svcProperties.setProperty(m_svcPropName, String.valueOf(actualPort));
-            
-            if (m_svcReg != null)
-            {
-                m_svcReg.setProperties(m_svcProperties);
-                m_svcProperties = new Properties(m_svcProperties);
-            }
-        }
-        
-        public void lifeCycleStarting(LifeCycle event) {}
-           
-        public void lifeCycleStopped(LifeCycle event) {}
-           
-        public void lifeCycleStopping(LifeCycle event) {}         
-    }
-}
\ No newline at end of file
diff --git a/http.jetty/src/main/java/org/apache/felix/http/jetty/DefaultContextImpl.java b/http.jetty/src/main/java/org/apache/felix/http/jetty/DefaultContextImpl.java
deleted file mode 100644
index ab832c4..0000000
--- a/http.jetty/src/main/java/org/apache/felix/http/jetty/DefaultContextImpl.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.http.jetty;
-
-
-import java.net.URL;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.osgi.framework.Bundle;
-import org.osgi.service.http.HttpContext;
-
-
-/**
- * Implementation of default HttpContext as per OSGi specification.
- *
- * Notes
- *
- *      - no current inclusion/support for permissions
- *      - security allows all request. Spec leaves security handling to be
- *        implementation specific, but does outline some suggested handling.
- *        Deeper than my understanding of HTTP at this stage, so left for now.
- */
-public class DefaultContextImpl implements HttpContext
-{
-    private Bundle m_bundle;
-
-
-    public DefaultContextImpl( Bundle bundle )
-    {
-        m_bundle = bundle;
-    }
-
-
-    public String getMimeType( String name )
-    {
-        return null;
-    }
-
-
-    public URL getResource( String name )
-    {
-        //TODO: need to grant "org.osgi.framework.AdminPermission" when
-        //      permissions are included.
-        Activator.debug( "getResource for:" + name );
-
-        //TODO: temp measure for name. Bundle classloading doesn't seem to find
-        // resources which have a leading "/". This code should be removed
-        // if the bundle classloader is changed to allow a leading "/"
-        if ( name.startsWith( "/" ) )
-        {
-            name = name.substring( 1 );
-        }
-
-        return m_bundle.getResource( name );
-    }
-
-
-    public boolean handleSecurity( HttpServletRequest request, HttpServletResponse response )
-    {
-        //TODO: need to look into what's appropriate for default security
-        //      handling. Default to all requests to be serviced for now.
-        return true;
-    }
-}
\ No newline at end of file
diff --git a/http.jetty/src/main/java/org/apache/felix/http/jetty/HttpServiceImpl.java b/http.jetty/src/main/java/org/apache/felix/http/jetty/HttpServiceImpl.java
deleted file mode 100644
index 2943703..0000000
--- a/http.jetty/src/main/java/org/apache/felix/http/jetty/HttpServiceImpl.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.http.jetty;
-
-
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.util.Dictionary;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.servlet.Context;
-import org.mortbay.jetty.servlet.OsgiResourceHolder;
-import org.mortbay.jetty.servlet.OsgiServletHandler;
-import org.mortbay.jetty.servlet.SessionHandler;
-import org.osgi.framework.Bundle;
-import org.osgi.service.http.HttpContext;
-import org.osgi.service.http.HttpService;
-import org.osgi.service.http.NamespaceException;
-import org.osgi.service.log.LogService;
-
-
-public class HttpServiceImpl implements HttpService
-{
-    /** global namesspace of all aliases that have been registered */
-    private static Map m_aliasNamespace = null;
-
-    /** local list of aliases registered by the bundle holding this service */
-    private Set m_localAliasSet = null;
-
-    /** Bundle which "got" this service instance from the service factory */
-    private Bundle m_bundle = null;
-    private Server m_server = null;
-    private OsgiServletHandler m_serverServletHandler = null;
-
-
-    public HttpServiceImpl( Bundle bundle, Server server, OsgiServletHandler serverServletHandler )
-    {
-        m_bundle = bundle;
-        m_server = server;
-        m_serverServletHandler = serverServletHandler;
-        m_localAliasSet = new HashSet();
-
-        if ( m_aliasNamespace == null )
-        {
-            m_aliasNamespace = new HashMap();
-        }
-    }
-
-
-    /**
-     * Initializes static variables.
-    **/
-    public static void initializeStatics()
-    {
-        if ( m_aliasNamespace != null )
-        {
-            m_aliasNamespace.clear();
-        }
-        ServletContextGroup.initializeStatics();
-    }
-
-
-    public HttpContext createDefaultHttpContext()
-    {
-        return new DefaultContextImpl( m_bundle );
-    }
-
-
-    public void registerServlet( String alias, Servlet servlet, Dictionary params, HttpContext osgiHttpContext )
-        throws ServletException, NamespaceException
-    {
-        Activator.debug( "http register servlet :" + m_bundle + ", alias: " + alias );
-
-        if ( !aliasValid( alias ) )
-        {
-            throw new IllegalArgumentException( "malformed alias" );
-        }
-
-        if ( ServletContextGroup.isServletRegistered( servlet ) )
-        {
-            throw new ServletException( "servlet already registered" );
-        }
-
-        // add alias with null details, and record servlet instance details
-        addAlias( alias, null );
-
-        //make sure alias is unique, and create
-        ServletContextGroup grp = null;
-
-        if ( osgiHttpContext == null )
-        {
-            osgiHttpContext = createDefaultHttpContext();
-        }
-
-        // servlets using same context must get same handler to ensure
-        // they share a common ServletContext
-        Activator.debug( "looking for context: " + osgiHttpContext );
-        grp = ServletContextGroup.getServletContextGroup( m_serverServletHandler, osgiHttpContext );
-
-        grp.addServlet( servlet, alias, params );
-
-        // update alias namespace with reference to group object for later
-        // unregistering
-        updateAlias( alias, grp );
-
-        // maybe should remove alias/servlet entries if exceptions?
-    }
-
-
-    public void registerResources( String alias, String name, HttpContext osgiHttpContext ) throws NamespaceException
-    {
-        Activator.debug( "** http register resource :" + m_bundle + ", alias: " + alias );
-
-        if ( !aliasValid( alias ) )
-        {
-            throw new IllegalArgumentException( "malformed alias: " + alias);
-        }
-        
-        if ( !nameValid( name ) )
-        {
-            throw new IllegalArgumentException( "malformed name: " + name);
-        }
-
-        // add alias with null details
-        addAlias( alias, null );
-
-        //make sure alias is unique, and create
-        Context hdlrContext = null;
-
-        if ( osgiHttpContext == null )
-        {
-            osgiHttpContext = createDefaultHttpContext();
-        }
-
-        // servlets using same context must get same handler to ensure
-        // they share a common ServletContext
-        Activator.debug( "looking for context: " + osgiHttpContext );
-        ServletContextGroup grp = ServletContextGroup.getServletContextGroup( m_serverServletHandler, osgiHttpContext );
-
-        grp.addResource( alias, name );
-
-        // update alias namespace with reference to group object for later
-        // unregistering
-        updateAlias( alias, grp );
-
-        // maybe should remove alias/servlet entries if exceptions?
-    }
-
-
-    public void unregister( String alias )
-    {
-        doUnregister( alias, true );
-    }
-
-
-    protected void unregisterAll()
-    {
-        // note that this is a forced unregister, so we shouldn't call destroy
-        // on any servlets
-        // unregister each alias for the bundle - copy list since it will
-        // change
-        String[] all = ( String[] ) m_localAliasSet.toArray( new String[0] );
-        for ( int ix = 0; ix < all.length; ix++ )
-        {
-            doUnregister( all[ix], false );
-        }
-    }
-
-
-    protected void doUnregister( String alias, boolean forced )
-    {
-        Activator.debug( "** http unregister servlet :" + m_bundle + ", alias: " + alias + ",forced:" + forced );
-        ServletContextGroup grp = removeAlias( alias );
-        if ( grp != null )
-        {
-            grp.remove( alias, forced );
-        }
-    }
-
-
-    protected void addAlias( String alias, Object obj ) throws NamespaceException
-    {
-        synchronized ( m_aliasNamespace )
-        {
-            if ( m_aliasNamespace.containsKey( alias ) )
-            {
-                throw new NamespaceException( "alias already registered" );
-            }
-
-            m_aliasNamespace.put( alias, obj );
-            m_localAliasSet.add( alias );
-        }
-    }
-
-
-    protected ServletContextGroup removeAlias( String alias )
-    {
-        synchronized ( m_aliasNamespace )
-        {
-            // remove alias, don't worry if doesn't exist
-            Object obj = m_aliasNamespace.remove( alias );
-            m_localAliasSet.remove( alias );
-            return ( ServletContextGroup ) obj;
-        }
-    }
-
-
-    protected void updateAlias( String alias, Object obj )
-    {
-        synchronized ( m_aliasNamespace )
-        {
-            // only update if already present
-            if ( m_aliasNamespace.containsKey( alias ) )
-            {
-                m_aliasNamespace.put( alias, obj );
-            }
-        }
-    }
-
-
-    protected boolean aliasValid( String alias )
-    {
-        if (alias == null)
-        {
-            return false;
-        }
-            
-        if (!alias.equals( "/" ) && ( !alias.startsWith( "/" ) || alias.endsWith( "/" ) ) )
-        {
-            return false;
-        }
-
-        return true;
-    }
-    
-    
-    protected boolean nameValid( String name )
-    {
-        if (name == null)
-        {
-            return false;
-        }
-            
-        if (name.endsWith( "/" ))
-        {
-            return false;
-        }
-
-        return true;
-    }
-}
\ No newline at end of file
diff --git a/http.jetty/src/main/java/org/apache/felix/http/jetty/LogServiceLog.java b/http.jetty/src/main/java/org/apache/felix/http/jetty/LogServiceLog.java
deleted file mode 100644
index f439a30..0000000
--- a/http.jetty/src/main/java/org/apache/felix/http/jetty/LogServiceLog.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.http.jetty;
-
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.mortbay.log.Logger;
-import org.osgi.service.log.LogService;
-
-
-public class LogServiceLog implements Logger
-{
-    private static Map loggers = new HashMap();
-
-    private final String m_name;
-
-    private boolean m_debugEnabled;
-
-
-    public LogServiceLog()
-    {
-        this( "org.mortbay.log" );
-    }
-
-
-    public LogServiceLog( String name )
-    {
-        this.m_name = name;
-    }
-
-
-    public Logger getLogger( String name )
-    {
-        Logger logger = ( Logger ) loggers.get( name );
-        if ( logger == null )
-        {
-            logger = new LogServiceLog( name );
-            logger.setDebugEnabled( isDebugEnabled() );
-            loggers.put( name, logger );
-        }
-        return logger;
-    }
-
-
-    public boolean isDebugEnabled()
-    {
-        return m_debugEnabled;
-    }
-
-
-    public void setDebugEnabled( boolean enabled )
-    {
-        this.m_debugEnabled = enabled;
-    }
-
-
-    public void debug( String msg, Throwable throwable )
-    {
-        log( LogService.LOG_DEBUG, msg, throwable );
-    }
-
-
-    public void debug( String msg, Object arg0, Object arg1 )
-    {
-        log( LogService.LOG_DEBUG, format( msg, arg0, arg1 ), null );
-    }
-
-
-    public void info( String msg, Object arg0, Object arg1 )
-    {
-        log( LogService.LOG_INFO, format( msg, arg0, arg1 ), null );
-    }
-
-
-    public void warn( String msg, Throwable throwable )
-    {
-        log( LogService.LOG_WARNING, msg, throwable );
-    }
-
-
-    public void warn( String msg, Object arg0, Object arg1 )
-    {
-        log( LogService.LOG_WARNING, format( msg, arg0, arg1 ), null );
-    }
-
-
-    public String toString()
-    {
-        return m_name;
-    }
-
-
-    private String format( String msg, Object arg0, Object arg1 )
-    {
-        int i0 = msg.indexOf( "{}" );
-        int i1 = i0 < 0 ? -1 : msg.indexOf( "{}", i0 + 2 );
-
-        if ( arg1 != null && i1 >= 0 )
-            msg = msg.substring( 0, i1 ) + arg1 + msg.substring( i1 + 2 );
-        if ( arg0 != null && i0 >= 0 )
-            msg = msg.substring( 0, i0 ) + arg0 + msg.substring( i0 + 2 );
-        return msg;
-    }
-
-
-    private void log( int level, String message, Throwable throwable )
-    {
-        Activator.log( level, m_name + ":" + message, throwable );
-    }
-}
diff --git a/http.jetty/src/main/java/org/apache/felix/http/jetty/ServletContextGroup.java b/http.jetty/src/main/java/org/apache/felix/http/jetty/ServletContextGroup.java
deleted file mode 100644
index 0a44ee4..0000000
--- a/http.jetty/src/main/java/org/apache/felix/http/jetty/ServletContextGroup.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.http.jetty;
-
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-
-import org.mortbay.jetty.servlet.OsgiResourceHolder;
-import org.mortbay.jetty.servlet.OsgiServletHandler;
-import org.mortbay.jetty.servlet.OsgiServletHolder;
-import org.mortbay.jetty.servlet.ServletHolder;
-import org.osgi.service.http.HttpContext;
-
-
-public class ServletContextGroup implements ServletContext
-{
-    /** global pool of all OSGi HttpContext that have been created */
-    private static Map m_contextMap = new HashMap();
-
-    /** global set of all servlet instances that have been registered */
-    private static Set m_servletSet = new HashSet();
-
-    private OsgiServletHandler m_hdlr = null;
-    private HttpContext m_osgiHttpContext = null;
-    private Hashtable m_attributes = null;
-
-
-    static void initializeStatics()
-    {
-        m_contextMap.clear();
-        m_servletSet.clear();
-    }
-
-
-    static ServletContextGroup getServletContextGroup( OsgiServletHandler hdlr, HttpContext osgiHttpContext )
-    {
-
-        ServletContextGroup grp = ( ServletContextGroup ) m_contextMap.get( osgiHttpContext );
-        if ( grp == null )
-        {
-            grp = new ServletContextGroup( hdlr, osgiHttpContext );
-            m_contextMap.put( osgiHttpContext, grp );
-        }
-
-        return grp;
-    }
-
-
-    static boolean isServletRegistered( Servlet servlet )
-    {
-        return m_servletSet.contains( servlet );
-    }
-
-
-    private ServletContextGroup( OsgiServletHandler hdlr, HttpContext osgiHttpContext )
-    {
-        init( hdlr, osgiHttpContext );
-    }
-
-
-    private void init( OsgiServletHandler hdlr, HttpContext osgiHttpContext )
-    {
-        m_hdlr = hdlr;
-        m_osgiHttpContext = osgiHttpContext;
-
-        m_attributes = new Hashtable();
-
-        m_contextMap.put( m_osgiHttpContext, this );
-    }
-
-
-    private void destroy()
-    {
-        m_contextMap.remove( m_osgiHttpContext );
-    }
-
-
-    public HttpContext getOsgiHttpContext()
-    {
-        return m_osgiHttpContext;
-    }
-
-
-    void addServlet( Servlet servlet, String alias, Dictionary params )
-    {
-        String wAlias = aliasWildcard( alias );
-        ServletHolder holder = new OsgiServletHolder( m_hdlr, servlet, wAlias, this, params );
-        m_hdlr.addOsgiServletHolder( wAlias, holder );
-        Activator.debug( " adding servlet instance: " + servlet );
-        m_servletSet.add( servlet );
-    }
-
-
-    void addResource( String alias, String path )
-    {
-        String wAlias = aliasWildcard( alias );
-        ServletHolder holder = new OsgiResourceHolder( m_hdlr, alias, path, this );
-        m_hdlr.addOsgiServletHolder( wAlias, holder );
-        Activator.debug( " adding resources for " + wAlias + " at: " + path );
-    }
-
-
-    void remove( String alias, boolean destroy )
-    {
-        String wAlias = aliasWildcard( alias );
-        ServletHolder holder = m_hdlr.removeOsgiServletHolder( wAlias );
-
-        if ( holder != null )
-        {
-            try
-            {
-                Servlet servlet = holder.getServlet();
-                if ( servlet != null )
-                {
-                    Activator.debug( " removing servlet instance: " + servlet );
-                    m_servletSet.remove( servlet );
-
-                    if ( destroy )
-                    {
-                        servlet.destroy();
-                    }
-
-                    if ( m_servletSet.isEmpty() )
-                    {
-                        destroy();
-                    }
-                }
-            }
-            catch ( ServletException se )
-            {
-                // may only be thrown if servlet in holder is null
-            }
-        }
-    }
-
-
-    private String aliasWildcard( String alias )
-    {
-        // add wilcard filter at the end of the alias to allow servlet to
-        // get requests which include sub-paths
-        return "/".equals( alias ) ? "/*" : alias + "/*";
-    }
-
-
-    // ServletContext interface for OSGi servlets
-
-    public ServletContext getContext( String contextName )
-    {
-        return m_hdlr.getServletContext().getContext( contextName );
-    }
-
-
-    public int getMajorVersion()
-    {
-        return m_hdlr.getServletContext().getMajorVersion();
-    }
-
-
-    public int getMinorVersion()
-    {
-        return m_hdlr.getServletContext().getMinorVersion();
-    }
-
-
-    public String getContextPath()
-    {
-        return m_hdlr.getServletContext().getContextPath();
-    }
-
-
-    public String getMimeType( String file )
-    {
-        String type = m_osgiHttpContext.getMimeType( file );
-        if ( type != null )
-        {
-            return type;
-        }
-
-        return m_hdlr.getServletContext().getMimeType( file );
-    }
-
-
-    public String getRealPath( String path )
-    {
-        // resources are contained in the bundle and thus are not
-        // available as normal files in the platform filesystem
-        return null;
-    }
-
-
-    public URL getResource( String path )
-    {
-        return m_osgiHttpContext.getResource( path );
-    }
-
-
-    public InputStream getResourceAsStream( String path )
-    {
-        URL res = getResource( path );
-        if ( res != null )
-        {
-            try
-            {
-                return res.openStream();
-            }
-            catch ( IOException ignore )
-            {
-                // might want to log, but actually don't care here
-            }
-        }
-
-        return null;
-    }
-
-
-    public Set getResourcePaths( String path )
-    {
-        // This is not implemented yet, might want to access the bundle entries
-        return null;
-    }
-
-
-    public RequestDispatcher getRequestDispatcher( String uri )
-    {
-        return m_hdlr.getServletContext().getRequestDispatcher( uri );
-    }
-
-
-    public RequestDispatcher getNamedDispatcher( String name )
-    {
-        if ( getMinorVersion() >= 2 )
-        {
-            return m_hdlr.getServletContext().getNamedDispatcher( name );
-        }
-
-        return null;
-    }
-
-
-    public String getServerInfo()
-    {
-        return m_hdlr.getServletContext().getServerInfo();
-    }
-
-
-    public String getServletContextName()
-    {
-        if ( getMinorVersion() >= 3 )
-        {
-            return m_hdlr.getServletContext().getServletContextName();
-        }
-
-        return null;
-    }
-
-
-    public Servlet getServlet( String servletName ) throws ServletException
-    {
-        return m_hdlr.getServletContext().getServlet( servletName );
-    }
-
-
-    public Enumeration getServletNames()
-    {
-        return m_hdlr.getServletContext().getServletNames();
-    }
-
-
-    public String getInitParameter( String name )
-    {
-        if ( getMinorVersion() >= 2 )
-        {
-            return m_hdlr.getServletContext().getInitParameter( name );
-        }
-
-        return null;
-    }
-
-
-    public Enumeration getInitParameterNames()
-    {
-        if ( getMinorVersion() >= 2 )
-        {
-            return m_hdlr.getServletContext().getInitParameterNames();
-        }
-
-        return Collections.enumeration( Collections.EMPTY_LIST );
-    }
-
-
-    /* (non-Javadoc)
-     * @see javax.servlet.ServletContext#getServlets()
-     */
-    public Enumeration getServlets()
-    {
-        return m_hdlr.getServletContext().getServlets();
-    }
-
-
-    public void log( Exception exception, String message )
-    {
-        m_hdlr.getServletContext().log( exception, message );
-    }
-
-
-    public void log( String message, Throwable throwable )
-    {
-        m_hdlr.getServletContext().log( message, throwable );
-    }
-
-
-    public void log( String message )
-    {
-        m_hdlr.getServletContext().log( message );
-    }
-
-
-    public void setAttribute( String name, Object value )
-    {
-        m_attributes.put( name, value );
-    }
-
-
-    public Object getAttribute( String name )
-    {
-        return m_attributes.get( name );
-    }
-
-
-    public Enumeration getAttributeNames()
-    {
-        return m_attributes.keys();
-    }
-
-
-    public void removeAttribute( String name )
-    {
-        m_attributes.remove( name );
-    }
-}
\ No newline at end of file
diff --git a/http.jetty/src/main/java/org/mortbay/jetty/servlet/OsgiResourceHolder.java b/http.jetty/src/main/java/org/mortbay/jetty/servlet/OsgiResourceHolder.java
deleted file mode 100644
index 5efcbf6..0000000
--- a/http.jetty/src/main/java/org/mortbay/jetty/servlet/OsgiResourceHolder.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.mortbay.jetty.servlet;
-
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.File;
-import java.net.URL;
-import java.net.URLConnection;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.felix.http.jetty.Activator;
-import org.apache.felix.http.jetty.ServletContextGroup;
-import org.mortbay.jetty.HttpConnection;
-import org.mortbay.jetty.HttpMethods;
-import org.mortbay.jetty.Request;
-import org.osgi.service.http.HttpContext;
-import org.osgi.service.log.LogService;
-
-
-public class OsgiResourceHolder extends ServletHolder
-{
-    private ServletContextGroup m_servletContextGroup;
-    private HttpContext m_osgiHttpContext;
-    private AccessControlContext m_acc;
-    private String m_path;
-
-
-    public OsgiResourceHolder( ServletHandler handler, String name, String path, ServletContextGroup servletContextGroup )
-    {
-        super();
-
-        setServletHandler( handler );
-        setName( name );
-
-        m_servletContextGroup = servletContextGroup;
-        m_osgiHttpContext = servletContextGroup.getOsgiHttpContext();
-        m_path = path;
-        if (m_path == null)
-        {
-            m_path = "";
-        }
-        
-        if ( System.getSecurityManager() != null )
-        {
-            m_acc = AccessController.getContext();
-        }
-    }
-
-
-    public synchronized Servlet getServlet()
-    {
-        return null;
-    }
-
-
-    // override "Holder" method to prevent instantiation
-    public synchronized Object newInstance()
-    {
-        return null;
-    }
-
-
-    public void handle( ServletRequest sRequest, ServletResponse sResponse ) throws ServletException, IOException
-    {
-        HttpServletRequest request = ( HttpServletRequest ) sRequest;
-        HttpServletResponse response = ( HttpServletResponse ) sResponse;
-        
-        // get the relative path (assume empty path if there is no path info)
-        // (FELIX-503)
-        String target = request.getPathInfo();
-        if (target == null) 
-        {
-            target = "";
-        }
-        
-        if (!target.startsWith("/"))
-        {
-            target += "/" + target;
-        }
-
-        Activator.debug( "handle for name:" + m_path + " (path=" + target + ")" );
-
-        if ( !m_osgiHttpContext.handleSecurity( request, response ) )
-        {
-            return;
-        }
-
-        // Create resource based name and see if we can resolve it
-        String resName = m_path + target;
-        Activator.debug( "** looking for: " + resName );
-        URL url = m_osgiHttpContext.getResource( resName );
-
-        if ( url == null )
-        {
-            Request base_request = sRequest instanceof Request ? ( Request ) sRequest : HttpConnection
-                .getCurrentConnection().getRequest();
-            base_request.setHandled( false );
-            return;
-        }
-
-        Activator.debug( "serving up:" + resName );
-
-        String method = request.getMethod();
-        if ( method.equals( HttpMethods.GET ) || method.equals( HttpMethods.POST ) || method.equals( HttpMethods.HEAD ) )
-        {
-            handleGet( request, response, url, resName );
-        }
-        else
-        {
-            try
-            {
-                response.sendError( HttpServletResponse.SC_NOT_IMPLEMENTED );
-            }
-            catch ( Exception e )
-            {/*TODO: include error logging*/
-            }
-        }
-    }
-
-
-    public void handleGet( HttpServletRequest request, final HttpServletResponse response, final URL url, String resName )
-        throws IOException
-    {
-        String encoding = m_osgiHttpContext.getMimeType( resName );
-
-        if ( encoding == null )
-        {
-            encoding = m_servletContextGroup.getMimeType( resName );
-        }
-
-        if ( encoding == null )
-        {
-            encoding = m_servletContextGroup.getMimeType( ".default" );
-        }
-
-        //TODO: not sure why this is needed, but sometimes get "IllegalState"
-        // errors if not included
-        response.setContentType( encoding );
-
-        long lastModified  = getLastModified(url);
-        
-        if (lastModified != 0)
-        {
-            response.setDateHeader("Last-Modified", lastModified);
-        }
-
-        if (!resourceModified(lastModified, request.getDateHeader("If-Modified-Since")))
-        {
-            response.setStatus(response.SC_NOT_MODIFIED);
-        }
-        else
-        {
-            // make sure we access the resource inside the bundle's access control
-            // context if supplied
-            if ( m_acc != null )
-            {
-                try
-                {
-                    AccessController.doPrivileged( new PrivilegedExceptionAction()
-                    {
-                        public Object run() throws Exception
-                        {
-                            copyResourceBytes( url, response );
-                            return null;
-                        }
-                    }, m_acc );
-                }
-                catch ( PrivilegedActionException ex )
-                {
-                    IOException ioe = ( IOException ) ex.getException();
-                    throw ioe;
-                }
-            }
-            else
-            {
-                copyResourceBytes( url, response );
-            }
-            
-            //TODO: set other http fields e.g. __LastModified, __ContentLength
-        }
-    }
-
-
-    private void copyResourceBytes( URL url, HttpServletResponse response ) throws IOException
-    {
-        OutputStream os = null;
-        InputStream is = null;
-
-        try
-        {
-            os = response.getOutputStream();
-            is = url.openStream();
-
-            int len = 0;
-            byte[] buf = new byte[1024];
-            int n = 0;
-
-            while ( ( n = is.read( buf, 0, buf.length ) ) >= 0 )
-            {
-                os.write( buf, 0, n );
-                len += n;
-            }
-
-            try
-            {
-                response.setContentLength( len );
-            }
-            catch ( IllegalStateException ex )
-            {
-                Activator.log( LogService.LOG_ERROR, "OsgiResourceHandler", ex );
-            }
-        }
-        finally
-        {
-            if ( is != null )
-            {
-                is.close();
-            }
-            if ( os != null )
-            {
-                os.close();
-            }
-        }
-    }
-
-
-    // override "Holder" method to prevent attempt to load
-    // the servlet class.
-    public void doStart() throws Exception
-    {
-    }
-
-
-    // override "Holder" method to prevent destroy, which is only called
-    // when a bundle manually unregisters
-    public void doStop()
-    {
-    }
-    
-    
-    /**
-     * Gets the last modified value for file modification detection.
-     * Aids in "conditional get" and intermediate proxy/node cacheing.
-     *
-     * Approach used follows that used by Sun for JNLP handling to workaround an 
-     * apparent issue where file URLs do not correctly return a last modified time.
-     * 
-     */
-    protected long getLastModified (URL resUrl)
-    {
-        long lastModified = 0;
-        
-        try 
-        {
-            // Get last modified time
-            URLConnection conn = resUrl.openConnection();
-            lastModified = conn.getLastModified();
-        } 
-        catch (Exception e) 
-        {
-            // do nothing
-        }
-
-        if (lastModified == 0) 
-        {
-            // Arguably a bug in the JRE will not set the lastModified for file URLs, and
-            // always return 0. This is a workaround for that problem.
-            String filepath = resUrl.getPath();
-            
-            if (filepath != null) 
-            {
-                File f = new File(filepath);
-                if (f.exists()) 
-                {
-                    lastModified = f.lastModified();
-                }
-            }
-        }
-        
-        Activator.debug( "url: " + resUrl  + ", lastModified:" + lastModified);
-        
-        return lastModified;
-    }
-    
-    
-    protected boolean resourceModified(long resTimestamp, long modSince)
-    {
-        boolean retval = false;
-        
-        // Have to normalise timestamps as HTTP times have last 3 digits as zero
-        modSince /= 1000;
-        resTimestamp /= 1000;
-        
-        // Timestamp check to see if modified - resTimestamp 0 check is for 
-        // safety in case we didn't manage to get a timestamp for the resource
-        if (resTimestamp == 0 || modSince == -1 || resTimestamp > modSince)
-        {
-            retval = true;
-        }
-        
-        return retval;
-    }
-    
-}
diff --git a/http.jetty/src/main/java/org/mortbay/jetty/servlet/OsgiServletHandler.java b/http.jetty/src/main/java/org/mortbay/jetty/servlet/OsgiServletHandler.java
deleted file mode 100644
index beaae87..0000000
--- a/http.jetty/src/main/java/org/mortbay/jetty/servlet/OsgiServletHandler.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.mortbay.jetty.servlet;
-
-
-import java.io.IOException;
-import java.net.URL;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.felix.http.jetty.Activator;
-import org.mortbay.util.LazyList;
-import org.osgi.service.log.LogService;
-
-
-public class OsgiServletHandler extends ServletHandler
-{
-    // allow external adding of osgi servlet holder
-    public void addOsgiServletHolder( String pathSpec, ServletHolder holder )
-    {
-        super.addServletWithMapping( holder, pathSpec );
-    }
-
-
-    public ServletHolder removeOsgiServletHolder( String pathSpec )
-    {
-        ServletMapping oldMapping = null;
-        ServletMapping[] mappings = getServletMappings();
-        for ( int i = 0; i < mappings.length && oldMapping == null; i++ )
-        {
-            String[] pathSpecs = mappings[i].getPathSpecs();
-            for ( int j = 0; j < pathSpecs.length && oldMapping == null; j++ )
-            {
-                if ( pathSpec.equals( pathSpecs[j] ) )
-                {
-                    oldMapping = mappings[i];
-                }
-            }
-        }
-
-        if ( oldMapping == null )
-        {
-            return null;
-        }
-
-        ServletHolder[] holders = getServlets();
-        if ( holders != null )
-        {
-            holders = ( ServletHolder[] ) holders.clone();
-        }
-
-        ServletHolder oldHolder = null;
-        for ( int i = 0; i < holders.length; i++ )
-        {
-            if ( oldMapping.getServletName().equals( holders[i].getName() ) )
-            {
-                oldHolder = holders[i];
-            }
-        }
-        if ( oldHolder == null )
-        {
-            return null;
-        }
-
-        try
-        {
-            setServlets( ( ServletHolder[] ) LazyList.removeFromArray( holders, oldHolder ) );
-            setServletMappings( ( ServletMapping[] ) LazyList.removeFromArray( mappings, oldMapping ) );
-
-            if (oldHolder.isStarted() && isStopped()) {
-                oldHolder.stop();
-            }
-
-            return ( ServletHolder ) oldHolder;
-        }
-        catch ( Exception e )
-        {
-            setServlets( holders );
-            if ( e instanceof RuntimeException )
-                throw ( RuntimeException ) e;
-            throw new RuntimeException( e );
-        }
-    }
-
-
-    // override standard handler behaviour to return resource from OSGi
-    // HttpContext
-    public URL getResource( String uriInContext )
-    {
-        Activator.debug( "OSGI ServletHandler getResource:" + uriInContext );
-        return null;
-    }
-
-
-    public void handle( String target, HttpServletRequest request, HttpServletResponse response, int type )
-        throws IOException, ServletException
-    {
-        Activator.debug( "dispatch path = " + target );
-        super.handle( target, request, response, type );
-    }
-
-}
diff --git a/http.jetty/src/main/java/org/mortbay/jetty/servlet/OsgiServletHolder.java b/http.jetty/src/main/java/org/mortbay/jetty/servlet/OsgiServletHolder.java
deleted file mode 100644
index 07b5aa1..0000000
--- a/http.jetty/src/main/java/org/mortbay/jetty/servlet/OsgiServletHolder.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.mortbay.jetty.servlet;
-
-
-import java.io.IOException;
-import java.util.Dictionary;
-import java.util.Enumeration;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.UnavailableException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.felix.http.jetty.ServletContextGroup;
-import org.osgi.service.http.HttpContext;
-
-
-public class OsgiServletHolder extends ServletHolder
-{
-    private Servlet m_servlet;
-    private ServletContextGroup m_servletContextGroup;
-    private ServletConfig m_config;
-
-
-    public OsgiServletHolder( ServletHandler handler, Servlet servlet, String name,
-        ServletContextGroup servletContextGroup, Dictionary params )
-    {
-        super(servlet);
-        setServletHandler( handler );
-        setName( name );
-        
-        m_servlet = servlet;
-        m_servletContextGroup = servletContextGroup;
-
-        // Seemed safer to copy params into parent holder, rather than override
-        // the getInitxxx methods.
-        if ( params != null )
-        {
-            Enumeration e = params.keys();
-            while ( e.hasMoreElements() )
-            {
-                Object key = e.nextElement();
-                setInitParameter( String.valueOf( key ), String.valueOf( params.get( key ) ) );
-            }
-        }
-    }
-
-
-    public synchronized Servlet getServlet()
-    {
-        return m_servlet;
-    }
-
-
-    public Servlet getOsgiServlet()
-    {
-        return m_servlet;
-    }
-
-
-    // override "Holder" method to prevent instantiation
-    public synchronized Object newInstance()
-    {
-        return getOsgiServlet();
-    }
-
-
-    public void handle( ServletRequest request, ServletResponse response ) throws ServletException,
-        UnavailableException, IOException
-    {
-        if ( m_servletContextGroup.getOsgiHttpContext().handleSecurity( ( HttpServletRequest ) request,
-            ( HttpServletResponse ) response ) )
-        {
-            // wrap request to get auth type and remote user
-            request = new HttpServiceHttpServletRequest( ( HttpServletRequest ) request );
-
-            // service request
-            super.handle( request, response );
-        }
-        else
-        {
-            //TODO: any other error/auth handling we should do in here?
-
-            // response.flushBuffer() if available
-            try
-            {
-                response.getClass().getDeclaredMethod( "flushBuffer", null ).invoke( response, null );
-            }
-            catch ( Exception ex )
-            {
-                // else ignore
-                ex.printStackTrace();
-            }
-        }
-    }
-
-
-    // override "Holder" method to prevent attempt to load
-    // the servlet class.
-    public void doStart() throws Exception
-    {
-        _class = m_servlet.getClass();
-
-        m_config = new Config()
-        {
-            public ServletContext getServletContext()
-            {
-                return m_servletContextGroup;
-            }
-        };
-
-        m_servlet.init( m_config );
-    }
-
-
-    // override "Holder" method to prevent destroy, which is only called
-    // when a bundle manually unregisters
-    public void doStop()
-    {
-    }
-
-    // Simple wrapper class returning the authentication type and remote user
-    // from the respective request attribute as specificed by the HttpService
-    // spec (step 4 in Section 102.7, Authentication)
-    private static class HttpServiceHttpServletRequest extends HttpServletRequestWrapper {
-
-        HttpServiceHttpServletRequest(HttpServletRequest request) {
-            super(request);
-        }
-
-        public String getAuthType()
-        {
-            // use the auth type attribute; should not be null, but
-            // better check and use wrapped result if missing
-            Object name = getAttribute( HttpContext.AUTHENTICATION_TYPE );
-            if (name != null) {
-                return name.toString();
-            }
-
-            return super.getAuthType();
-        }
-
-        public String getRemoteUser()
-        {
-            // use the remote user attribute; should not be null, but
-            // better check and use wrapped result if missing
-            Object name = getAttribute( HttpContext.REMOTE_USER );
-            if (name != null) {
-                return name.toString();
-            }
-
-            return super.getRemoteUser();
-        }
-    }
-}
diff --git a/pom.xml b/pom.xml
index 7d419c8..fd4ca8b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -108,7 +108,6 @@
         <module>log</module>
         <module>eventadmin</module>
         <module>http</module>
-        <!--module>http.jetty</module-->
         <module>upnp</module>
         <module>scr</module>
         <module>configadmin</module>
