Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 271042 - update HttpService to jetty7
Summary: update HttpService to jetty7
Status: CLOSED WONTFIX
Alias: None
Product: Jetty
Classification: RT
Component: osgi (show other bugs)
Version: 7.0.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 7.0.0 M1   Edit
Assignee: Hugues Malphettes CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-02 15:48 EDT by Jesse McConnell CLA
Modified: 2011-12-17 18:42 EST (History)
12 users (show)

See Also:


Attachments
port of org.eclipse.equinox.http.jetty6 to jetty7 (11.39 KB, patch)
2009-10-17 17:42 EDT, Hugues Malphettes CLA
no flags Details | Diff
jetty6 to jetty7: patch done from scratch (9.91 KB, text/plain)
2010-04-16 17:21 EDT, Hugues Malphettes CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse McConnell CLA 2009-04-02 15:48:25 EDT
As part of the effort to get better up to speed on the internals of eclipse and how jetty is in use, we want to work on updating the org.eclipse.equinox.http.jetty6 service to jetty7.
Comment 1 Hugues Malphettes CLA 2009-10-17 17:42:06 EDT
Created attachment 149819 [details]
port of org.eclipse.equinox.http.jetty6 to jetty7

Here is a port of the equinox plugin that starts jetty inside eclipse-rcp.
The original source is here:
:pserver:anonymous@dev.eclipse.org:/cvsroot/rt org.eclipse.equinox/compendium/bundles/org.eclipse.equinox.http.jetty6

Please note that implementation of the JettyCustomizer will also need to be ported to jetty7. There is no implementation of JettyCustomizer in eclipse-SDK. If we were to remove jetty6 and place jetty7 we would need to track the projects that use this interface and advise them to upgrade.

The eclipse-SDK help server calls the static public APIs of this bundle. I have tested that it works with these changes. I have also tested that the HttpService still works.


Please note that in fact this plugin does now contains the HttpService implementation.
Equinox uses the bundle org.eclipse.equinox.http.servlet (found here:
:pserver:anonymous@dev.eclipse.org:/cvsroot/rt org.eclipse.equinox/compendium/bundles/org.eclipse.equinox.http.servlet)
It defines the ProxyServlet. When the ProxyServlet is deployed on jetty (or any other servlet container really) in the root context and with the servlet mapping "/*" it will register an implementation of HttpService.

The bundle org.eclipse.equinox.http.jetty* will deploy an instance of such ProxyServlet that provides in its turn the HttpService.

I hope this helps.
Comment 2 Alex Blewitt CLA 2010-03-03 04:29:57 EST
A few comments on the patch:

 Comment-Header: Both Eclipse-LazyStart and Bundle-ActivationPolicy are specified for compatibility with 3.2
-Eclipse-LazyStart: true
-Bundle-ActivationPolicy: lazy
+Eclipse-LazyStart: false

Why is it non-lazy? Having Eclipse-LazyStart: false is unnecessary, since it's the default. But we should change the Comment-Header if needed.

     *              the Jetty connector; in case of Jetty 6 the context is of 
-    *              type <code>org.mortbay.jetty.Connector</code>
+    *              type <code>org.eclipse.jetty.server.Connector</code>

The first line needs to be updated to Jetty 7 as well.

The bundle is located at:

org.eclipse.equinox/compendium/bundles/org.eclipse.equinox.http.jetty6

Should it not be put in a new bundle (rather than patched) to:

org.eclipse.equinox/compendium/bundles/org.eclipse.equinox.http.jetty7? That way, both could be provided/tested.
Comment 3 Gunnar Wagenknecht CLA 2010-03-10 08:49:33 EST
(In reply to comment #1)
> Please note that implementation of the JettyCustomizer will also need to be
> ported to jetty7.

This is an extension interface which allows to customize Jetty instances created by the Equinox Jetty HttpService bundle. It is meant to be very specific to the Jetty versions so it can be assumed that clients/implementors are expected to deal with API changes depending on different Jetty versions.
Comment 4 Hugues Malphettes CLA 2010-04-05 14:08:47 EDT
(In reply to comment #2)

Hi Alex, sorry somehow I did not trail the activiaty on this bug.
Thanks for the in-depth review.

> A few comments on the patch:
> 
>  Comment-Header: Both Eclipse-LazyStart and Bundle-ActivationPolicy are
> specified for compatibility with 3.2
> -Eclipse-LazyStart: true
> -Bundle-ActivationPolicy: lazy
> +Eclipse-LazyStart: false
> 
> Why is it non-lazy? Having Eclipse-LazyStart: false is unnecessary, since it's
> the default. But we should change the Comment-Header if needed.

I agree in the context of this bug it is a mistake to not make it lazily activated.
I believe I got confused because I wanted this jetty management to take a second position and give a chance to jety-osgi to manage the jetty instances instead. I kind of wanted to make this look suspicious so we could work on this later on.

We should definitely keep Bundle-ActivationPolicy: lazy in the context of this patch.

> 
>      *              the Jetty connector; in case of Jetty 6 the context is of 
> -    *              type <code>org.mortbay.jetty.Connector</code>
> +    *              type <code>org.eclipse.jetty.server.Connector</code>
> 
> The first line needs to be updated to Jetty 7 as well.
> 
> The bundle is located at:
> 
> org.eclipse.equinox/compendium/bundles/org.eclipse.equinox.http.jetty6
> 
> Should it not be put in a new bundle (rather than patched) to:
> 
> org.eclipse.equinox/compendium/bundles/org.eclipse.equinox.http.jetty7? That
> way, both could be provided/tested.

I agree, that is the way I developped it on github:
http://github.com/hmalphettes/eclipse.equinox.http.jetty7

Thanks, this helps a lot.
Comment 5 Hugues Malphettes CLA 2010-04-16 17:21:46 EDT
Created attachment 165154 [details]
jetty6 to jetty7: patch done from scratch

We are working on this bug for Equinox here: 309529
I have redone the migration from scratch and from a fresh checkout of the equinox cvs.
I have followed the suggestion of everyone and named the project org.eclipse.equinox.jetty7
Comment 6 Michael Gorovoy CLA 2010-05-12 12:27:07 EDT
Assigning to Hugues.
Comment 7 Jesse McConnell CLA 2011-07-27 11:01:52 EDT
ok...over a year now

Where are we at with this issue now?  Can we close it?
Comment 8 Hugues Malphettes CLA 2011-12-17 18:42:23 EST
Equinox adopted jetty8 based on the work done here.
The jetty8 work took place in bug 309529