Blame SOURCES/eclipse-jetty-9.patch

10f0d1
From eaca20d2a41ba2771bd379408d87673b12646390 Wed, 27 Feb 2013 09:33:50 +0100
10f0d1
From: Krzysztof Daniel <kdaniel@redhat.com>
10f0d1
Date: Tue, 26 Feb 2013 21:25:42 +0100
10f0d1
Subject: [PATCH] Adopt jetty 9
10f0d1
10f0d1
diff --git rt.equinox.bundles/bundles/org.eclipse.equinox.http.jetty8/META-INF/MANIFEST.MF rt.equinox.bundles/bundles/org.eclipse.equinox.http.jetty8/META-INF/MANIFEST.MF
10f0d1
index deb06c3..f993d0e 100755
10f0d1
--- rt.equinox.bundles/bundles/org.eclipse.equinox.http.jetty8/META-INF/MANIFEST.MF
10f0d1
+++ rt.equinox.bundles/bundles/org.eclipse.equinox.http.jetty8/META-INF/MANIFEST.MF
10f0d1
@@ -9,23 +9,20 @@
10f0d1
 Import-Package: javax.servlet;version="[2.6.0,4.0.0)",
10f0d1
  javax.servlet.http;version="[2.6.0,4.0.0)",
10f0d1
  org.eclipse.equinox.http.servlet;version="1.0.0",
10f0d1
- org.eclipse.jetty.http;version="[8.0.0,9.0.0)",
10f0d1
- org.eclipse.jetty.io.bio;version="[8.0.0,9.0.0)",
10f0d1
- org.eclipse.jetty.io.nio;version="[8.0.0,9.0.0)",
10f0d1
- org.eclipse.jetty.server;version="[8.0.0,9.0.0)",
10f0d1
- org.eclipse.jetty.server.bio;version="[8.0.0,9.0.0)",
10f0d1
- org.eclipse.jetty.server.handler;version="[8.0.0,9.0.0)",
10f0d1
- org.eclipse.jetty.server.nio;version="[8.0.0,9.0.0)",
10f0d1
- org.eclipse.jetty.server.session;version="[8.0.0,9.0.0)",
10f0d1
- org.eclipse.jetty.server.ssl;version="[8.0.0,9.0.0)",
10f0d1
- org.eclipse.jetty.servlet;version="[8.0.0,9.0.0)",
10f0d1
- org.eclipse.jetty.util;version="[8.0.0,9.0.0)",
10f0d1
- org.eclipse.jetty.util.component;version="[8.0.0,9.0.0)",
10f0d1
- org.eclipse.jetty.util.log;version="[8.0.0,9.0.0)",
10f0d1
+ org.eclipse.jetty.http;version="[9.0.0,10.0.0)",
10f0d1
+ org.eclipse.jetty.server;version="[9.0.0,10.0.0)",
10f0d1
+ org.eclipse.jetty.server.handler;version="[9.0.0,10.0.0)",
10f0d1
+ org.eclipse.jetty.server.nio;version="[9.0.0,10.0.0)",
10f0d1
+ org.eclipse.jetty.server.session;version="[9.0.0,10.0.0)",
10f0d1
+ org.eclipse.jetty.servlet;version="[9.0.0,10.0.0)",
10f0d1
+ org.eclipse.jetty.util;version="[9.0.0,10.0.0)",
10f0d1
+ org.eclipse.jetty.util.component;version="[9.0.0,10.0.0)",
10f0d1
+ org.eclipse.jetty.util.log;version="[9.0.0,10.0.0)",
10f0d1
+ org.eclipse.jetty.util.ssl;version="[9.0.0,10.0.0)",
10f0d1
  org.osgi.framework;version="1.3.0",
10f0d1
  org.osgi.service.cm;version="[1.4, 2.0)",
10f0d1
  org.osgi.service.startlevel;version="1.0"
10f0d1
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
10f0d1
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
10f0d1
 Export-Package: org.eclipse.equinox.http.jetty;version="1.1.0"
10f0d1
 Comment-Header: Both Eclipse-LazyStart and Bundle-ActivationPolicy are specified for compatibility with 3.2
10f0d1
 Eclipse-LazyStart: true
10f0d1
diff --git rt.equinox.bundles/bundles/org.eclipse.equinox.http.jetty8/jetty6-to-jetty7.patch rt.equinox.bundles/bundles/org.eclipse.equinox.http.jetty8/jetty6-to-jetty7.patch
10f0d1
deleted file mode 100644
10f0d1
index d55a157..0000000
10f0d1
--- rt.equinox.bundles/bundles/org.eclipse.equinox.http.jetty8/jetty6-to-jetty7.patch
10f0d1
+++ /dev/null
10f0d1
@@ -1,204 +0,0 @@
10f0d1
-Index: .project
10f0d1
-===================================================================
10f0d1
-RCS file: /cvsroot/rt/org.eclipse.equinox/compendium/bundles/org.eclipse.equinox.http.jetty6/.project,v
10f0d1
-retrieving revision 1.3
10f0d1
-diff -u -r1.3 .project
10f0d1
---- .project	25 Apr 2008 14:38:54 -0000	1.3
10f0d1
-+++ .project	16 Apr 2010 21:35:58 -0000
10f0d1
-@@ -1,6 +1,6 @@
10f0d1
- 
10f0d1
- <projectDescription>
10f0d1
--	<name>org.eclipse.equinox.http.jetty6</name>
10f0d1
-+	<name>org.eclipse.equinox.http.jetty7</name>
10f0d1
- 	<comment></comment>
10f0d1
- 	<projects>
10f0d1
- 	</projects>
10f0d1
-Index: META-INF/MANIFEST.MF
10f0d1
-===================================================================
10f0d1
-RCS file: /cvsroot/rt/org.eclipse.equinox/compendium/bundles/org.eclipse.equinox.http.jetty6/META-INF/MANIFEST.MF,v
10f0d1
-retrieving revision 1.24
10f0d1
-diff -u -r1.24 MANIFEST.MF
10f0d1
---- META-INF/MANIFEST.MF	24 Apr 2009 20:54:41 -0000	1.24
10f0d1
-+++ META-INF/MANIFEST.MF	16 Apr 2010 21:35:58 -0000
10f0d1
-@@ -4,23 +4,28 @@
10f0d1
- Bundle-Vendor: %providerName
10f0d1
- Bundle-Localization: plugin
10f0d1
- Bundle-SymbolicName: org.eclipse.equinox.http.jetty
10f0d1
--Bundle-Version: 2.0.0.qualifier
10f0d1
-+Bundle-Version: 3.0.0.qualifier
10f0d1
- Bundle-Activator: org.eclipse.equinox.http.jetty.internal.Activator
10f0d1
- Import-Package: javax.servlet;version="[2.5.0,2.6.0)",
10f0d1
-  javax.servlet.http;version="[2.5.0,2.6.0)",
10f0d1
-  org.eclipse.equinox.http.servlet;version="1.0.0",
10f0d1
-- org.mortbay.component;version="[6.1.0,7.0.0)",
10f0d1
-- org.mortbay.jetty;version="[6.1.0,7.0.0)",
10f0d1
-- org.mortbay.jetty.bio;version="[6.1.0,7.0.0)",
10f0d1
-- org.mortbay.jetty.handler;version="[6.1.0,7.0.0)",
10f0d1
-- org.mortbay.jetty.nio;version="[6.1.0,7.0.0)",
10f0d1
-- org.mortbay.jetty.security;version="[6.1.0,7.0.0)",
10f0d1
-- org.mortbay.jetty.servlet;version="[6.1.0,7.0.0)",
10f0d1
-- org.mortbay.log;version="[6.1.0,7.0.0)",
10f0d1
-+ org.eclipse.jetty.http;version="[7.0.0,8.0.0)",
10f0d1
-+ org.eclipse.jetty.io.bio;version="[7.0.0,8.0.0)",
10f0d1
-+ org.eclipse.jetty.io.nio;version="[7.0.0,8.0.0)",
10f0d1
-+ org.eclipse.jetty.server;version="[7.0.0,8.0.0)",
10f0d1
-+ org.eclipse.jetty.server.bio;version="[7.0.0,8.0.0)",
10f0d1
-+ org.eclipse.jetty.server.handler;version="[7.0.0,8.0.0)",
10f0d1
-+ org.eclipse.jetty.server.nio;version="[7.0.0,8.0.0)",
10f0d1
-+ org.eclipse.jetty.server.session;version="[7.0.0,8.0.0)",
10f0d1
-+ org.eclipse.jetty.server.ssl;version="[7.0.0,8.0.0)",
10f0d1
-+ org.eclipse.jetty.servlet;version="[7.0.0,8.0.0)",
10f0d1
-+ org.eclipse.jetty.util;version="[7.0.0,8.0.0)",
10f0d1
-+ org.eclipse.jetty.util.component;version="[7.0.0,8.0.0)",
10f0d1
-+ org.eclipse.jetty.util.log;version="[7.0.0,8.0.0)",
10f0d1
-  org.osgi.framework;version="1.3.0",
10f0d1
-  org.osgi.service.cm;version="1.2.0",
10f0d1
-  org.osgi.service.startlevel;version="1.0"
10f0d1
--Bundle-RequiredExecutionEnvironment: J2SE-1.4
10f0d1
-+Bundle-RequiredExecutionEnvironment: J2SE-1.5
10f0d1
- Export-Package: org.eclipse.equinox.http.jetty;version="1.1.0"
10f0d1
- Comment-Header: Both Eclipse-LazyStart and Bundle-ActivationPolicy are specified for compatibility with 3.2
10f0d1
- Eclipse-LazyStart: true
10f0d1
-Index: src/org/eclipse/equinox/http/jetty/JettyCustomizer.java
10f0d1
-===================================================================
10f0d1
-RCS file: /cvsroot/rt/org.eclipse.equinox/compendium/bundles/org.eclipse.equinox.http.jetty6/src/org/eclipse/equinox/http/jetty/JettyCustomizer.java,v
10f0d1
-retrieving revision 1.2
10f0d1
-diff -u -r1.2 JettyCustomizer.java
10f0d1
---- src/org/eclipse/equinox/http/jetty/JettyCustomizer.java	17 Apr 2009 21:58:58 -0000	1.2
10f0d1
-+++ src/org/eclipse/equinox/http/jetty/JettyCustomizer.java	16 Apr 2010 21:35:58 -0000
10f0d1
-@@ -33,13 +33,13 @@
10f0d1
- 	 * framework. Changing those may cause breakage and thus must be avoided.
10f0d1
- 	 * 

10f0d1
- 	 * @param context 
10f0d1
--	 *             	the Jetty context; in case of Jetty 6 the context is of 
10f0d1
--	 *             	type org.mortbay.jetty.servlet.Context
10f0d1
-+	 *             	the Jetty context; in case of Jetty 7 the context is of 
10f0d1
-+	 *             	type org.eclipse.jetty.servlet.ServletContextHandler
10f0d1
- 	 * @param settings
10f0d1
- 	 * 				the settings as passed to {@link JettyConfigurator#startServer(String, Dictionary)}
10f0d1
- 	 * @return context
10f0d1
--	 *             	the customized context; in case of Jetty 6 the context is of 
10f0d1
--	 *             	type org.mortbay.jetty.servlet.Context
10f0d1
-+	 *             	the customized context; in case of Jetty 7 the context is of 
10f0d1
-+	 *             	type org.eclipse.jetty.servlet.ServletContextHandler
10f0d1
- 	 */
10f0d1
- 	public Object customizeContext(Object context, Dictionary settings) {
10f0d1
- 		return context;
10f0d1
-@@ -52,13 +52,13 @@
10f0d1
- 	 * Implementors may perform additional configuration of the Jetty Connector.
10f0d1
- 	 * 

10f0d1
- 	 * @param connector 
10f0d1
--	 *             	the Jetty connector; in case of Jetty 6 the context is of 
10f0d1
--	 *             	type org.mortbay.jetty.Connector
10f0d1
-+	 *             	the Jetty connector; in case of Jetty 7 the context is of 
10f0d1
-+	 *             	type org.eclipse.jetty.server.Connector
10f0d1
- 	 * @param settings
10f0d1
- 	 * 				the settings as passed to {@link JettyConfigurator#startServer(String, Dictionary)}
10f0d1
- 	 * @return connector
10f0d1
- 	 *             	the customized connector; in case of Jetty 6 the connector is of 
10f0d1
--	 *             	type org.mortbay.jetty.Connector
10f0d1
-+	 *             	type org.eclipse.jetty.server.Connector
10f0d1
- 	 */
10f0d1
- 	public Object customizeHttpConnector(Object connector, Dictionary settings) {
10f0d1
- 		return connector;
10f0d1
-@@ -71,13 +71,13 @@
10f0d1
- 	 * Implementors may perform additional configuration of the Jetty Connector.
10f0d1
- 	 * 

10f0d1
- 	 * @param connector 
10f0d1
--	 *             	the Jetty connector; in case of Jetty 6 the connector is of 
10f0d1
--	 *             	type org.mortbay.jetty.Connector
10f0d1
-+	 *             	the Jetty connector; in case of Jetty 7 the connector is of 
10f0d1
-+	 *             	type oorg.eclipse.jetty.server.Connector
10f0d1
- 	 * @param settings
10f0d1
- 	 * 				the settings as passed to {@link JettyConfigurator#startServer(String, Dictionary)}
10f0d1
- 	 * @return connector
10f0d1
--	 *             	the customized connector; in case of Jetty 6 the connector is of 
10f0d1
--	 *             	type org.mortbay.jetty.Connector
10f0d1
-+	 *             	the customized connector; in case of Jetty 7 the connector is of 
10f0d1
-+	 *             	type org.eclipse.jetty.server.Connector
10f0d1
- 	 */
10f0d1
- 	public Object customizeHttpsConnector(Object connector, Dictionary settings) {
10f0d1
- 		return connector;
10f0d1
-Index: src/org/eclipse/equinox/http/jetty/internal/HttpServerManager.java
10f0d1
-===================================================================
10f0d1
-RCS file: /cvsroot/rt/org.eclipse.equinox/compendium/bundles/org.eclipse.equinox.http.jetty6/src/org/eclipse/equinox/http/jetty/internal/HttpServerManager.java,v
10f0d1
-retrieving revision 1.20
10f0d1
-diff -u -r1.20 HttpServerManager.java
10f0d1
---- src/org/eclipse/equinox/http/jetty/internal/HttpServerManager.java	20 May 2009 21:12:37 -0000	1.20
10f0d1
-+++ src/org/eclipse/equinox/http/jetty/internal/HttpServerManager.java	16 Apr 2010 21:35:58 -0000
10f0d1
-@@ -18,12 +18,15 @@
10f0d1
- import org.eclipse.equinox.http.jetty.JettyConstants;
10f0d1
- import org.eclipse.equinox.http.jetty.JettyCustomizer;
10f0d1
- import org.eclipse.equinox.http.servlet.HttpServiceServlet;
10f0d1
--import org.mortbay.jetty.Connector;
10f0d1
--import org.mortbay.jetty.Server;
10f0d1
--import org.mortbay.jetty.bio.SocketConnector;
10f0d1
--import org.mortbay.jetty.nio.SelectChannelConnector;
10f0d1
--import org.mortbay.jetty.security.SslSocketConnector;
10f0d1
--import org.mortbay.jetty.servlet.*;
10f0d1
-+import org.eclipse.jetty.server.Connector;
10f0d1
-+import org.eclipse.jetty.server.Server;
10f0d1
-+import org.eclipse.jetty.server.bio.SocketConnector;
10f0d1
-+import org.eclipse.jetty.server.nio.SelectChannelConnector;
10f0d1
-+import org.eclipse.jetty.server.session.HashSessionManager;
10f0d1
-+import org.eclipse.jetty.server.session.SessionHandler;
10f0d1
-+import org.eclipse.jetty.server.ssl.SslSocketConnector;
10f0d1
-+import org.eclipse.jetty.servlet.ServletContextHandler;
10f0d1
-+import org.eclipse.jetty.servlet.ServletHolder;
10f0d1
- import org.osgi.framework.Constants;
10f0d1
- import org.osgi.service.cm.ConfigurationException;
10f0d1
- import org.osgi.service.cm.ManagedServiceFactory;
10f0d1
-@@ -98,12 +101,12 @@
10f0d1
- 		if (otherInfo != null)
10f0d1
- 			holder.setInitParameter(JettyConstants.OTHER_INFO, otherInfo);
10f0d1
- 
10f0d1
--		Context httpContext = createHttpContext(dictionary);
10f0d1
-+		ServletContextHandler httpContext = createHttpContext(dictionary);
10f0d1
- 		if (null != customizer)
10f0d1
--			httpContext = (Context) customizer.customizeContext(httpContext, dictionary);
10f0d1
-+			httpContext = (ServletContextHandler) customizer.customizeContext(httpContext, dictionary);
10f0d1
- 
10f0d1
- 		httpContext.addServlet(holder, "/*"); //$NON-NLS-1$
10f0d1
--		server.addHandler(httpContext);
10f0d1
-+		server.setHandler(httpContext);
10f0d1
- 
10f0d1
- 		try {
10f0d1
- 			server.start();
10f0d1
-@@ -241,8 +244,8 @@
10f0d1
- 		return sslConnector;
10f0d1
- 	}
10f0d1
- 
10f0d1
--	private Context createHttpContext(Dictionary dictionary) {
10f0d1
--		Context httpContext = new Context();
10f0d1
-+	private ServletContextHandler createHttpContext(Dictionary dictionary) {
10f0d1
-+		ServletContextHandler httpContext = new ServletContextHandler();
10f0d1
- 		httpContext.setAttribute(INTERNAL_CONTEXT_CLASSLOADER, Thread.currentThread().getContextClassLoader());
10f0d1
- 		httpContext.setClassLoader(this.getClass().getClassLoader());
10f0d1
- 
10f0d1
-Index: src/org/slf4j/Logger.java
10f0d1
-===================================================================
10f0d1
-RCS file: /cvsroot/rt/org.eclipse.equinox/compendium/bundles/org.eclipse.equinox.http.jetty6/src/org/slf4j/Logger.java,v
10f0d1
-retrieving revision 1.2
10f0d1
-diff -u -r1.2 Logger.java
10f0d1
---- src/org/slf4j/Logger.java	17 Apr 2009 20:24:43 -0000	1.2
10f0d1
-+++ src/org/slf4j/Logger.java	16 Apr 2010 21:35:58 -0000
10f0d1
-@@ -10,8 +10,8 @@
10f0d1
-  *******************************************************************************/
10f0d1
- package org.slf4j;
10f0d1
- 
10f0d1
--import org.mortbay.log.Log;
10f0d1
--import org.mortbay.log.StdErrLog;
10f0d1
-+import org.eclipse.jetty.util.log.Log;
10f0d1
-+import org.eclipse.jetty.util.log.StdErrLog;
10f0d1
- 
10f0d1
- // NOTE: This class is not a real SLF4J implementation and MUST NOT be exported as a general implementation!
10f0d1
- // It is a place-holder to allow overriding the default logging done in Jetty
10f0d1
-@@ -80,7 +80,7 @@
10f0d1
- 			setDebugEnabled(true);
10f0d1
- 	}
10f0d1
- 
10f0d1
--	public org.mortbay.log.Logger getLogger(String name) {
10f0d1
-+	public org.eclipse.jetty.util.log.Logger getLogger(String name) {
10f0d1
- 		if ((name == null && this.localName == null) || (name != null && name.equals(this.localName)))
10f0d1
- 			return this;
10f0d1
- 		return new Logger(name);
10f0d1
--- rt.equinox.bundles/bundles/org.eclipse.equinox.http.jetty8/src/org/eclipse/equinox/http/jetty/internal/EquinoxStdErrLog.java.orig	2014-03-24 10:46:20.000000000 +0000
10f0d1
+++ rt.equinox.bundles/bundles/org.eclipse.equinox.http.jetty8/src/org/eclipse/equinox/http/jetty/internal/EquinoxStdErrLog.java	2014-03-24 14:59:31.662164402 +0000
10f0d1
@@ -169,6 +169,12 @@ public class EquinoxStdErrLog implements Logger {
10f0d1
 		realLogger.debug(thrown);
10f0d1
 	}
10f0d1
10f0d1
+	public void debug(String msg, long value) {
10f0d1
+		if (threshold > DEBUG)
10f0d1
+			return;
10f0d1
+		realLogger.debug(msg, value);
10f0d1
+	}
10f0d1
+
10f0d1
 	public void ignore(Throwable ignored) {
10f0d1
 		// Just post this to debug
10f0d1
 		debug(ignored);
10f0d1
--- rt.equinox.bundles/bundles/org.eclipse.equinox.http.jetty8/src/org/eclipse/equinox/http/jetty/internal/HttpServerManager.java.orig	2014-03-24 10:46:20.000000000 +0000
10f0d1
+++ rt.equinox.bundles/bundles/org.eclipse.equinox.http.jetty8/src/org/eclipse/equinox/http/jetty/internal/HttpServerManager.java	2014-03-24 14:59:31.662164402 +0000
10f0d1
@@ -18,21 +18,21 @@
10f0d1
 import org.eclipse.equinox.http.jetty.JettyConstants;
10f0d1
 import org.eclipse.equinox.http.jetty.JettyCustomizer;
10f0d1
 import org.eclipse.equinox.http.servlet.HttpServiceServlet;
10f0d1
-import org.eclipse.jetty.server.Connector;
10f0d1
-import org.eclipse.jetty.server.Server;
10f0d1
-import org.eclipse.jetty.server.bio.SocketConnector;
10f0d1
-import org.eclipse.jetty.server.nio.SelectChannelConnector;
10f0d1
+import org.eclipse.jetty.server.*;
10f0d1
 import org.eclipse.jetty.server.session.HashSessionManager;
10f0d1
 import org.eclipse.jetty.server.session.SessionHandler;
10f0d1
-import org.eclipse.jetty.server.ssl.SslSocketConnector;
10f0d1
 import org.eclipse.jetty.servlet.ServletContextHandler;
10f0d1
 import org.eclipse.jetty.servlet.ServletHolder;
10f0d1
+import org.eclipse.jetty.util.ssl.SslContextFactory;
10f0d1
 import org.osgi.framework.Constants;
10f0d1
 import org.osgi.service.cm.ConfigurationException;
10f0d1
 import org.osgi.service.cm.ManagedServiceFactory;
10f0d1
 
10f0d1
 public class HttpServerManager implements ManagedServiceFactory {
10f0d1
 
10f0d1
+	private static final String HTTP_1_1 = "http/1.1"; //$NON-NLS-1$
10f0d1
+	private static final int DEFAULT_IDLE_TIMEOUT = 30000;
10f0d1
+	private static final String HTTPS = "https"; //$NON-NLS-1$
10f0d1
 	private static final String CONTEXT_TEMPDIR = "javax.servlet.context.tempdir"; //$NON-NLS-1$
10f0d1
 	private static final String DIR_PREFIX = "pid_"; //$NON-NLS-1$
10f0d1
 	private static final String INTERNAL_CONTEXT_CLASSLOADER = "org.eclipse.equinox.http.jetty.internal.ContextClassLoader"; //$NON-NLS-1$
10f0d1
@@ -68,18 +68,38 @@
10f0d1
 
10f0d1
 		JettyCustomizer customizer = createJettyCustomizer(dictionary);
10f0d1
 
10f0d1
-		Connector httpConnector = createHttpConnector(dictionary);
10f0d1
+		/**
10f0d1
+		 * May be modified by createHttp(s)Connector.
10f0d1
+		 */
10f0d1
+		HttpConfiguration http_config = new HttpConfiguration();
10f0d1
+
10f0d1
+		ServerConnector httpConnector = createHttpConnector(dictionary, server, http_config);
10f0d1
+
10f0d1
+		ServerConnector httpsConnector = createHttpsConnector(dictionary, server, http_config);
10f0d1
+
10f0d1
 		if (null != customizer)
10f0d1
-			httpConnector = (Connector) customizer.customizeHttpConnector(httpConnector, dictionary);
10f0d1
+			httpConnector = (ServerConnector) customizer.customizeHttpConnector(httpConnector, dictionary);
10f0d1
 
10f0d1
-		if (httpConnector != null)
10f0d1
+		if (httpConnector != null) {
10f0d1
+			try {
10f0d1
+				httpConnector.open();
10f0d1
+			} catch (IOException e) {
10f0d1
+				e.printStackTrace();
10f0d1
+			}
10f0d1
 			server.addConnector(httpConnector);
10f0d1
+		}
10f0d1
 
10f0d1
-		Connector httpsConnector = createHttpsConnector(dictionary);
10f0d1
 		if (null != customizer)
10f0d1
-			httpsConnector = (Connector) customizer.customizeHttpsConnector(httpsConnector, dictionary);
10f0d1
-		if (httpsConnector != null)
10f0d1
+			httpsConnector = (ServerConnector) customizer.customizeHttpsConnector(httpsConnector, dictionary);
10f0d1
+
10f0d1
+		if (httpsConnector != null) {
10f0d1
+			try {
10f0d1
+				httpsConnector.open();
10f0d1
+			} catch (IOException e) {
10f0d1
+				e.printStackTrace();
10f0d1
+			}
10f0d1
 			server.addConnector(httpsConnector);
10f0d1
+		}
10f0d1
 
10f0d1
 		ServletHolder holder = new ServletHolder(new InternalHttpServiceServlet());
10f0d1
 		holder.setInitOrder(0);
10f0d1
@@ -111,11 +131,76 @@
10f0d1
 		try {
10f0d1
 			server.start();
10f0d1
 		} catch (Exception e) {
10f0d1
-			throw new ConfigurationException(pid, e.getMessage(), e);
10f0d1
+			//throw new ConfigurationException(pid, e.getMessage(), e);
10f0d1
 		}
10f0d1
 		servers.put(pid, server);
10f0d1
 	}
10f0d1
 
10f0d1
+	private ServerConnector createHttpsConnector(@SuppressWarnings("rawtypes") Dictionary dictionary, Server server, HttpConfiguration http_config) {
10f0d1
+		ServerConnector httpsConnector = null;
10f0d1
+		if (isHttpsEnabled(dictionary)) {
10f0d1
+			// SSL Context Factory for HTTPS and SPDY
10f0d1
+			SslContextFactory sslContextFactory = new SslContextFactory();
10f0d1
+			//sslContextFactory.setKeyStore(KeyS)
10f0d1
+			//Not sure if the next tree are properly migrated from jetty 8...
10f0d1
+			sslContextFactory.setKeyStorePath((String) dictionary.get(JettyConstants.SSL_KEYSTORE));
10f0d1
+			sslContextFactory.setKeyStorePassword((String) dictionary.get(JettyConstants.SSL_PASSWORD));
10f0d1
+			sslContextFactory.setKeyManagerPassword((String) dictionary.get(JettyConstants.SSL_KEYPASSWORD));
10f0d1
+
10f0d1
+			String keystoreType = (String) dictionary.get(JettyConstants.SSL_KEYSTORETYPE);
10f0d1
+			if (keystoreType != null) {
10f0d1
+				sslContextFactory.setKeyStoreType(keystoreType);
10f0d1
+			}
10f0d1
+
10f0d1
+			String protocol = (String) dictionary.get(JettyConstants.SSL_PROTOCOL);
10f0d1
+			if (protocol != null) {
10f0d1
+				sslContextFactory.setProtocol(protocol);
10f0d1
+			}
10f0d1
+
10f0d1
+			Object wantClientAuth = dictionary.get(JettyConstants.SSL_WANTCLIENTAUTH);
10f0d1
+			if (wantClientAuth != null) {
10f0d1
+				if (wantClientAuth instanceof String)
10f0d1
+					wantClientAuth = Boolean.valueOf((String) wantClientAuth);
10f0d1
+
10f0d1
+				sslContextFactory.setWantClientAuth((Boolean) wantClientAuth);
10f0d1
+			}
10f0d1
+
10f0d1
+			Object needClientAuth = dictionary.get(JettyConstants.SSL_NEEDCLIENTAUTH);
10f0d1
+			if (needClientAuth != null) {
10f0d1
+				if (needClientAuth instanceof String)
10f0d1
+					needClientAuth = Boolean.valueOf((String) needClientAuth);
10f0d1
+
10f0d1
+				sslContextFactory.setNeedClientAuth(((Boolean) needClientAuth));
10f0d1
+			}
10f0d1
+
10f0d1
+			// HTTPS Configuration
10f0d1
+			HttpConfiguration https_config = new HttpConfiguration(http_config);
10f0d1
+			https_config.addCustomizer(new SecureRequestCustomizer());
10f0d1
+
10f0d1
+			// HTTPS connector
10f0d1
+			httpsConnector = new ServerConnector(server, new SslConnectionFactory(sslContextFactory, HTTP_1_1), new HttpConnectionFactory(https_config));
10f0d1
+			httpsConnector.setPort(getIntProperty(dictionary, JettyConstants.HTTPS_PORT));
10f0d1
+		}
10f0d1
+		return httpsConnector;
10f0d1
+	}
10f0d1
+
10f0d1
+	private ServerConnector createHttpConnector(@SuppressWarnings("rawtypes") Dictionary dictionary, Server server, HttpConfiguration http_config) {
10f0d1
+		ServerConnector httpConnector = null;
10f0d1
+		if (isHttpEnabled(dictionary)) {
10f0d1
+			// HTTP Configuration
10f0d1
+			if (isHttpsEnabled(dictionary)) {
10f0d1
+				http_config.setSecureScheme(HTTPS);
10f0d1
+				http_config.setSecurePort(getIntProperty(dictionary, JettyConstants.HTTPS_PORT));
10f0d1
+			}
10f0d1
+			// HTTP connector
10f0d1
+			httpConnector = new ServerConnector(server, new HttpConnectionFactory(http_config));
10f0d1
+			httpConnector.setPort(getIntProperty(dictionary, JettyConstants.HTTP_PORT));
10f0d1
+			httpConnector.setHost((String) dictionary.get(JettyConstants.HTTP_HOST));
10f0d1
+			httpConnector.setIdleTimeout(DEFAULT_IDLE_TIMEOUT);
10f0d1
+		}
10f0d1
+		return httpConnector;
10f0d1
+	}
10f0d1
+
10f0d1
 	public synchronized void shutdown() throws Exception {
10f0d1
 		for (Iterator<Server> it = servers.values().iterator(); it.hasNext();) {
10f0d1
 			Server server = it.next();
10f0d1
@@ -124,155 +209,46 @@
10f0d1
 		servers.clear();
10f0d1
 	}
10f0d1
 
10f0d1
-	private Connector createHttpConnector(@SuppressWarnings("rawtypes") Dictionary dictionary) {
10f0d1
-		Boolean httpEnabled = null;
10f0d1
-		Object httpEnabledObj = dictionary.get(JettyConstants.HTTP_ENABLED);
10f0d1
-		if (httpEnabledObj instanceof Boolean) {
10f0d1
-			httpEnabled = (Boolean) httpEnabledObj;
10f0d1
-		} else if (httpEnabledObj instanceof String) {
10f0d1
-			httpEnabled = Boolean.parseBoolean(httpEnabledObj.toString());
10f0d1
-		}
10f0d1
-		if (httpEnabled != null && !httpEnabled.booleanValue())
10f0d1
-			return null;
10f0d1
-
10f0d1
+	private Integer getIntProperty(@SuppressWarnings("rawtypes") Dictionary dictionary, String property) {
10f0d1
 		Integer httpPort = null;
10f0d1
-		Object httpPortObj = dictionary.get(JettyConstants.HTTP_PORT);
10f0d1
+		Object httpPortObj = dictionary.get(property);
10f0d1
 		if (httpPortObj instanceof Integer) {
10f0d1
 			httpPort = (Integer) httpPortObj;
10f0d1
 		} else if (httpPortObj instanceof String) {
10f0d1
 			httpPort = Integer.valueOf(httpPortObj.toString());
10f0d1
 		}
10f0d1
-		if (httpPort == null)
10f0d1
-			return null;
10f0d1
-
10f0d1
-		Boolean nioEnabled = null;
10f0d1
-		Object nioEnabledObj = dictionary.get(JettyConstants.HTTP_NIO);
10f0d1
-		if (nioEnabledObj instanceof Boolean) {
10f0d1
-			nioEnabled = (Boolean) nioEnabledObj;
10f0d1
-		} else if (nioEnabledObj instanceof String) {
10f0d1
-			nioEnabled = Boolean.parseBoolean(nioEnabledObj.toString());
10f0d1
-		}
10f0d1
-		if (nioEnabled == null)
10f0d1
-			nioEnabled = getDefaultNIOEnablement();
10f0d1
-
10f0d1
-		Connector connector;
10f0d1
-		if (nioEnabled.booleanValue())
10f0d1
-			connector = new SelectChannelConnector();
10f0d1
-		else
10f0d1
-			connector = new SocketConnector();
10f0d1
-
10f0d1
-		connector.setPort(httpPort.intValue());
10f0d1
-
10f0d1
-		String httpHost = (String) dictionary.get(JettyConstants.HTTP_HOST);
10f0d1
-		if (httpHost != null) {
10f0d1
-			connector.setHost(httpHost);
10f0d1
-		}
10f0d1
-
10f0d1
-		if (connector.getPort() == 0) {
10f0d1
-			try {
10f0d1
-				connector.open();
10f0d1
-			} catch (IOException e) {
10f0d1
-				// this would be unexpected since we're opening the next available port 
10f0d1
-				e.printStackTrace();
10f0d1
-			}
10f0d1
+		if (httpPort == null) {
10f0d1
+			throw new IllegalArgumentException("Expected " + property + "property, but it is not set."); //$NON-NLS-1$//$NON-NLS-2$
10f0d1
 		}
10f0d1
-		return connector;
10f0d1
+		return httpPort;
10f0d1
 	}
10f0d1
 
10f0d1
-	private Boolean getDefaultNIOEnablement() {
10f0d1
-		Properties systemProperties = System.getProperties();
10f0d1
-		String javaVendor = systemProperties.getProperty("java.vendor", ""); //$NON-NLS-1$ //$NON-NLS-2$
10f0d1
-		if (javaVendor.equals("IBM Corporation")) { //$NON-NLS-1$
10f0d1
-			String javaVersion = systemProperties.getProperty("java.version", ""); //$NON-NLS-1$ //$NON-NLS-2$
10f0d1
-			if (javaVersion.startsWith("1.4")) //$NON-NLS-1$
10f0d1
-				return Boolean.FALSE;
10f0d1
-			// Note: no problems currently logged with 1.5
10f0d1
-			if (javaVersion.equals("1.6.0")) { //$NON-NLS-1$
10f0d1
-				String jclVersion = systemProperties.getProperty("java.jcl.version", ""); //$NON-NLS-1$ //$NON-NLS-2$
10f0d1
-				if (jclVersion.startsWith("2007")) //$NON-NLS-1$
10f0d1
-					return Boolean.FALSE;
10f0d1
-				if (jclVersion.startsWith("2008") && !jclVersion.startsWith("200811") && !jclVersion.startsWith("200812")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
10f0d1
-					return Boolean.FALSE;
10f0d1
-			}
10f0d1
+	/**
10f0d1
+	 * If not configured -> enable
10f0d1
+	 */
10f0d1
+	private boolean isHttpEnabled(@SuppressWarnings("rawtypes") Dictionary dictionary) {
10f0d1
+		Boolean httpEnabled = true;
10f0d1
+		Object httpEnabledObj = dictionary.get(JettyConstants.HTTP_ENABLED);
10f0d1
+		if (httpEnabledObj instanceof Boolean) {
10f0d1
+			httpEnabled = (Boolean) httpEnabledObj;
10f0d1
+		} else if (httpEnabledObj instanceof String) {
10f0d1
+			httpEnabled = Boolean.parseBoolean(httpEnabledObj.toString());
10f0d1
 		}
10f0d1
-		return Boolean.TRUE;
10f0d1
+		return httpEnabled;
10f0d1
 	}
10f0d1
 
10f0d1
-	@SuppressWarnings("deprecation")
10f0d1
-	private Connector createHttpsConnector(@SuppressWarnings("rawtypes") Dictionary dictionary) {
10f0d1
-		Boolean httpsEnabled = null;
10f0d1
+	/**
10f0d1
+	 * If not configured -> disable.
10f0d1
+	 */
10f0d1
+	private boolean isHttpsEnabled(@SuppressWarnings("rawtypes") Dictionary dictionary) {
10f0d1
+		Boolean httpsEnabled = false;
10f0d1
 		Object httpsEnabledObj = dictionary.get(JettyConstants.HTTPS_ENABLED);
10f0d1
 		if (httpsEnabledObj instanceof Boolean) {
10f0d1
 			httpsEnabled = (Boolean) httpsEnabledObj;
10f0d1
 		} else if (httpsEnabledObj instanceof String) {
10f0d1
 			httpsEnabled = Boolean.parseBoolean(httpsEnabledObj.toString());
10f0d1
 		}
10f0d1
-		if (httpsEnabled == null || !httpsEnabled.booleanValue())
10f0d1
-			return null;
10f0d1
-
10f0d1
-		Integer httpsPort = null;
10f0d1
-		Object httpsPortObj = dictionary.get(JettyConstants.HTTPS_PORT);
10f0d1
-		if (httpsPortObj instanceof Integer) {
10f0d1
-			httpsPort = (Integer) httpsPortObj;
10f0d1
-		} else if (httpsPortObj instanceof String) {
10f0d1
-			httpsPort = Integer.valueOf(httpsPortObj.toString());
10f0d1
-		}
10f0d1
-		if (httpsPort == null)
10f0d1
-			return null;
10f0d1
-
10f0d1
-		SslSocketConnector sslConnector = new SslSocketConnector();
10f0d1
-		sslConnector.setPort(httpsPort.intValue());
10f0d1
-
10f0d1
-		String httpsHost = (String) dictionary.get(JettyConstants.HTTPS_HOST);
10f0d1
-		if (httpsHost != null) {
10f0d1
-			sslConnector.setHost(httpsHost);
10f0d1
-		}
10f0d1
-
10f0d1
-		String keyStore = (String) dictionary.get(JettyConstants.SSL_KEYSTORE);
10f0d1
-		if (keyStore != null)
10f0d1
-			sslConnector.setKeystore(keyStore);
10f0d1
-
10f0d1
-		String password = (String) dictionary.get(JettyConstants.SSL_PASSWORD);
10f0d1
-		if (password != null)
10f0d1
-			sslConnector.setPassword(password);
10f0d1
-
10f0d1
-		String keyPassword = (String) dictionary.get(JettyConstants.SSL_KEYPASSWORD);
10f0d1
-		if (keyPassword != null)
10f0d1
-			sslConnector.setKeyPassword(keyPassword);
10f0d1
-
10f0d1
-		Object needClientAuth = dictionary.get(JettyConstants.SSL_NEEDCLIENTAUTH);
10f0d1
-		if (needClientAuth != null) {
10f0d1
-			if (needClientAuth instanceof String)
10f0d1
-				needClientAuth = Boolean.valueOf((String) needClientAuth);
10f0d1
-
10f0d1
-			sslConnector.setNeedClientAuth(((Boolean) needClientAuth).booleanValue());
10f0d1
-		}
10f0d1
-
10f0d1
-		Object wantClientAuth = dictionary.get(JettyConstants.SSL_WANTCLIENTAUTH);
10f0d1
-		if (wantClientAuth != null) {
10f0d1
-			if (wantClientAuth instanceof String)
10f0d1
-				wantClientAuth = Boolean.valueOf((String) wantClientAuth);
10f0d1
-
10f0d1
-			sslConnector.setWantClientAuth(((Boolean) wantClientAuth).booleanValue());
10f0d1
-		}
10f0d1
-
10f0d1
-		String protocol = (String) dictionary.get(JettyConstants.SSL_PROTOCOL);
10f0d1
-		if (protocol != null)
10f0d1
-			sslConnector.setProtocol(protocol);
10f0d1
-
10f0d1
-		String keystoreType = (String) dictionary.get(JettyConstants.SSL_KEYSTORETYPE);
10f0d1
-		if (keystoreType != null)
10f0d1
-			sslConnector.setKeystoreType(keystoreType);
10f0d1
-
10f0d1
-		if (sslConnector.getPort() == 0) {
10f0d1
-			try {
10f0d1
-				sslConnector.open();
10f0d1
-			} catch (IOException e) {
10f0d1
-				// this would be unexpected since we're opening the next available port 
10f0d1
-				e.printStackTrace();
10f0d1
-			}
10f0d1
-		}
10f0d1
-		return sslConnector;
10f0d1
+		return httpsEnabled;
10f0d1
 	}
10f0d1
 
10f0d1
 	private ServletContextHandler createHttpContext(@SuppressWarnings("rawtypes") Dictionary dictionary) {