You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by gn...@apache.org on 2022/12/08 13:02:20 UTC
[camel] 03/05: Migration to Jetty 11
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch jakarta/rewritten
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 094fdadca773a309003483231cab90448cf740c6
Author: Vladimir V. Bychkov <gi...@bychkov.name>
AuthorDate: Mon Nov 14 09:56:27 2022 +0100
Migration to Jetty 11
(cherry picked from commit 5e57bb6cc86bfdbc474f91fc2c152cb0fc03a9ff)
---
.../org/apache/camel/catalog/components/jetty.json | 4 +-
.../camel/component/cometd/CometdComponent.java | 2 +-
.../services/org/apache/camel/other.properties | 2 +-
.../src/generated/resources/jetty-common.json | 2 +-
.../component/jetty/CamelContinuationServlet.java | 70 +++++++++++++++-------
.../camel/component/jetty/JettyHttpComponent.java | 23 ++-----
.../camel/component/jetty/MultiPartFilter.java | 2 +-
.../JettyHttp11EndpointUriFactory.java} | 4 +-
.../JettyHttpComponent11Configurer.java} | 13 ++--
.../JettyHttpEndpoint11Configurer.java} | 13 ++--
.../services/org/apache/camel/component/jetty | 2 +-
.../org/apache/camel/configurer/jetty-component | 2 +-
.../org/apache/camel/configurer/jetty-endpoint | 2 +-
.../services/org/apache/camel/send-dynamic/jetty | 2 +-
.../org/apache/camel/urifactory/jetty-endpoint | 2 +-
.../camel/component/{jetty9 => jetty11}/jetty.json | 4 +-
.../camel-jetty/src/main/docs/jetty-component.adoc | 4 +-
.../{jetty9 => jetty11}/AttachmentHttpBinding.java | 11 ++--
.../CamelInputStreamContentProvider.java | 2 +-
.../{jetty9 => jetty11}/HttpSendDynamicAware.java | 2 +-
.../JettyContentExchange11.java} | 6 +-
.../JettyHttpComponent11.java} | 10 ++--
.../JettyHttpEndpoint11.java} | 12 ++--
.../jetty/JettyComponentMuteExceptionTest.java | 6 +-
.../jetty/JettyHttpEndpointDisconnectTest.java | 5 +-
.../jetty/TwoCamelContextWithJettyRouteTest.java | 10 ++--
.../async/JettyAsyncContinuationTimeoutTest.java | 2 +-
.../jetty/JettyComponentSpringConfiguredTest.xml | 2 +-
.../apache/camel/component/jetty/jetty-https.xml | 2 +-
.../tracing/decorators/JettySpanDecorator.java | 2 +-
.../component/websocket/WebsocketComponent.java | 2 +-
.../component/ComponentsBuilderFactory.java | 2 +-
.../dsl/JettyComponentBuilderFactory.java | 6 +-
.../src/generated/resources/metadata.json | 2 +-
.../builder/endpoint/StaticEndpointBuilders.java | 4 +-
.../dsl/JettyHttpEndpointBuilderFactory.java | 8 +--
.../infra/jetty/services/JettyEmbeddedService.java | 2 +-
37 files changed, 130 insertions(+), 121 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jetty.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jetty.json
index 932d1f3b777..5003ce42d7a 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jetty.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/jetty.json
@@ -3,12 +3,12 @@
"kind": "component",
"name": "jetty",
"title": "Jetty",
- "description": "Expose HTTP endpoints using Jetty 9.",
+ "description": "Expose HTTP endpoints using Jetty 11.",
"deprecated": false,
"deprecationNote": "",
"firstVersion": "1.2.0",
"label": "http",
- "javaType": "org.apache.camel.component.jetty9.JettyHttpComponent9",
+ "javaType": "org.apache.camel.component.jetty11.JettyHttpComponent9",
"supportLevel": "Stable",
"groupId": "org.apache.camel",
"artifactId": "camel-jetty",
diff --git a/components/camel-cometd/src/main/java/org/apache/camel/component/cometd/CometdComponent.java b/components/camel-cometd/src/main/java/org/apache/camel/component/cometd/CometdComponent.java
index 12f5338d5d3..f0d61e77b52 100644
--- a/components/camel-cometd/src/main/java/org/apache/camel/component/cometd/CometdComponent.java
+++ b/components/camel-cometd/src/main/java/org/apache/camel/component/cometd/CometdComponent.java
@@ -233,7 +233,7 @@ public class CometdComponent extends DefaultComponent implements SSLContextParam
sslParams = retrieveGlobalSslContextParameters();
}
- SslContextFactory sslContextFactory = new SslContextFactory();
+ SslContextFactory.Server sslContextFactory = new SslContextFactory.Server();
sslContextFactory.setEndpointIdentificationAlgorithm(null);
if (sslParams != null) {
sslContextFactory.setSslContext(sslParams.createSSLContext(getCamelContext()));
diff --git a/components/camel-jetty-common/src/generated/resources/META-INF/services/org/apache/camel/other.properties b/components/camel-jetty-common/src/generated/resources/META-INF/services/org/apache/camel/other.properties
index 4bd0b14e0b8..2f8523a0a41 100644
--- a/components/camel-jetty-common/src/generated/resources/META-INF/services/org/apache/camel/other.properties
+++ b/components/camel-jetty-common/src/generated/resources/META-INF/services/org/apache/camel/other.properties
@@ -4,4 +4,4 @@ groupId=org.apache.camel
artifactId=camel-jetty-common
version=4.0.0-SNAPSHOT
projectName=Camel :: Jetty :: Common
-projectDescription=Camel Jetty 9.x support
+projectDescription=Camel Jetty 11.x support
diff --git a/components/camel-jetty-common/src/generated/resources/jetty-common.json b/components/camel-jetty-common/src/generated/resources/jetty-common.json
index 5b3692c7b37..bb8eaa1de6e 100644
--- a/components/camel-jetty-common/src/generated/resources/jetty-common.json
+++ b/components/camel-jetty-common/src/generated/resources/jetty-common.json
@@ -3,7 +3,7 @@
"kind": "other",
"name": "jetty-common",
"title": "Jetty Common",
- "description": "Camel Jetty 9.x support",
+ "description": "Camel Jetty 11.x support",
"deprecated": false,
"firstVersion": "2.15.0",
"supportLevel": "Stable",
diff --git a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java
index d29ec69c55d..f84464c92d3 100644
--- a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java
+++ b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java
@@ -23,6 +23,10 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;
+import jakarta.servlet.AsyncContext;
+import jakarta.servlet.AsyncEvent;
+import jakarta.servlet.AsyncListener;
+import jakarta.servlet.DispatcherType;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@@ -41,8 +45,6 @@ import org.apache.camel.http.common.HttpMessage;
import org.apache.camel.spi.UnitOfWork;
import org.apache.camel.support.ObjectHelper;
import org.apache.camel.util.UnsafeUriCharactersEncoder;
-import org.eclipse.jetty.continuation.Continuation;
-import org.eclipse.jetty.continuation.ContinuationSupport;
/**
* Servlet which leverage <a href="http://wiki.eclipse.org/Jetty/Feature/Continuations">Jetty Continuations</a>.
@@ -162,27 +164,19 @@ public class CamelContinuationServlet extends CamelServlet {
final Exchange result = (Exchange) request.getAttribute(EXCHANGE_ATTRIBUTE_NAME);
if (result == null) {
// no asynchronous result so leverage continuation
- final Continuation continuation = ContinuationSupport.getContinuation(request);
- if (continuation.isInitial() && continuationTimeout != null) {
+ AsyncContext asyncContext = request.startAsync();
+ if (isInitial(request) && continuationTimeout != null) {
// set timeout on initial
- continuation.setTimeout(continuationTimeout);
+ asyncContext.setTimeout(continuationTimeout.longValue());
}
+ asyncContext.addListener(new ExpiredListener(consumer), request, response);
// are we suspended and a request is dispatched initially?
- if (consumer.isSuspended() && continuation.isInitial()) {
+ if (consumer.isSuspended() && isInitial(request)) {
response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
return;
}
- if (continuation.isExpired()) {
- String id = (String) continuation.getAttribute(EXCHANGE_ATTRIBUTE_ID);
- // remember this id as expired
- expiredExchanges.put(id, id);
- log.warn("Continuation expired of exchangeId: {}", id);
- consumer.getBinding().doWriteExceptionResponse(new TimeoutException(), response);
- return;
- }
-
// a new request so create an exchange
// must be prototype scoped (not pooled) so we create the exchange via endpoint
final Exchange exchange = consumer.createExchange(false);
@@ -215,7 +209,7 @@ public class CamelContinuationServlet extends CamelServlet {
if (log.isTraceEnabled()) {
log.trace("Suspending continuation of exchangeId: {}", exchange.getExchangeId());
}
- continuation.setAttribute(EXCHANGE_ATTRIBUTE_ID, exchange.getExchangeId());
+ request.setAttribute(EXCHANGE_ATTRIBUTE_ID, exchange.getExchangeId());
// we want to handle the UoW
UnitOfWork uow = exchange.getUnitOfWork();
@@ -232,9 +226,6 @@ public class CamelContinuationServlet extends CamelServlet {
ee.setUnitOfWork(uow);
}
- // must suspend before we process the exchange
- continuation.suspend();
-
ClassLoader oldTccl = overrideTccl(exchange);
if (log.isTraceEnabled()) {
@@ -251,8 +242,8 @@ public class CamelContinuationServlet extends CamelServlet {
log.trace("Resuming continuation of exchangeId: {}", exchange.getExchangeId());
}
// resume processing after both, sync and async callbacks
- continuation.setAttribute(EXCHANGE_ATTRIBUTE_NAME, exchange);
- continuation.resume();
+ request.setAttribute(EXCHANGE_ATTRIBUTE_NAME, exchange);
+ asyncContext.dispatch();
} else {
log.warn("Cannot resume expired continuation of exchangeId: {}", exchange.getExchangeId());
consumer.releaseExchange(exchange, false);
@@ -292,6 +283,43 @@ public class CamelContinuationServlet extends CamelServlet {
}
}
+ private boolean isInitial(HttpServletRequest request) {
+ return request.getDispatcherType() != DispatcherType.ASYNC;
+ }
+
+ private class ExpiredListener implements AsyncListener {
+
+ private HttpConsumer consumer;
+
+ public ExpiredListener(HttpConsumer consumer) {
+ this.consumer = consumer;
+ }
+
+ @Override
+ public void onComplete(AsyncEvent event) throws IOException {
+ }
+
+ @Override
+ public void onTimeout(AsyncEvent event) throws IOException {
+ HttpServletRequest request = (HttpServletRequest) event.getSuppliedRequest();
+ HttpServletResponse response = (HttpServletResponse) event.getSuppliedResponse();
+ String id = (String) request.getAttribute(EXCHANGE_ATTRIBUTE_ID);
+ // remember this id as expired
+ expiredExchanges.put(id, id);
+ log.warn("Continuation expired of exchangeId: {}", id);
+ consumer.getBinding().doWriteExceptionResponse(new TimeoutException(), response);
+ return;
+ }
+
+ @Override
+ public void onError(AsyncEvent event) throws IOException {
+ }
+
+ @Override
+ public void onStartAsync(AsyncEvent event) throws IOException {
+ }
+ }
+
private void updateHttpPath(Exchange exchange, String contextPath) {
String httpPath = (String) exchange.getIn().getHeader(JettyHttpConstants.HTTP_PATH);
// encode context path in case it contains unsafe chars, because HTTP_PATH isn't decoded at this moment
diff --git a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
index 9bbb6b9ef80..126cef3ced4 100644
--- a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
+++ b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
@@ -26,6 +26,7 @@ import java.net.URISyntaxException;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.EventListener;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -73,8 +74,6 @@ import org.eclipse.jetty.jmx.MBeanContainer;
import org.eclipse.jetty.server.AbstractConnector;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.HttpConnectionFactory;
-import org.eclipse.jetty.server.MultiPartFormDataCompliance;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
@@ -591,7 +590,7 @@ public abstract class JettyHttpComponent extends HttpCommonComponent
protected Connector createConnector(Server server, JettyHttpEndpoint endpoint) {
// now we just use the SelectChannelConnector as the default connector
- SslContextFactory sslcf = null;
+ SslContextFactory.Server sslcf = null;
// Note that this was set on the endpoint when it was constructed. It was
// either explicitly set at the component or on the endpoint, but either way,
@@ -601,12 +600,12 @@ public abstract class JettyHttpComponent extends HttpCommonComponent
if (endpointSslContextParameters != null) {
try {
- sslcf = createSslContextFactory(endpointSslContextParameters, false);
+ sslcf = (SslContextFactory.Server) createSslContextFactory(endpointSslContextParameters, false);
} catch (Exception e) {
throw new RuntimeCamelException(e);
}
} else if ("https".equals(endpoint.getProtocol())) {
- sslcf = new SslContextFactory();
+ sslcf = new SslContextFactory.Server();
sslcf.setEndpointIdentificationAlgorithm(null);
String keystoreProperty = System.getProperty(JETTY_SSL_KEYSTORE);
if (keystoreProperty != null) {
@@ -634,7 +633,7 @@ public abstract class JettyHttpComponent extends HttpCommonComponent
}
protected abstract AbstractConnector createConnectorJettyInternal(
- Server server, JettyHttpEndpoint endpoint, SslContextFactory sslcf);
+ Server server, JettyHttpEndpoint endpoint, SslContextFactory.Server sslcf);
private SslContextFactory createSslContextFactory(SSLContextParameters ssl, boolean client)
throws GeneralSecurityException, IOException {
@@ -1177,16 +1176,6 @@ public abstract class JettyHttpComponent extends HttpCommonComponent
// use rest enabled resolver in case we use rest
camelServlet.setServletResolveConsumerStrategy(new HttpRestServletResolveConsumerStrategy());
- //must make RFC7578 as default to avoid using the deprecated MultiPartInputStreamParser
- try {
- connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration()
- .setMultiPartFormDataCompliance(MultiPartFormDataCompliance.RFC7578);
- } catch (Exception e) {
- // ignore this due to OSGi problems
- LOG.debug("Cannot set MultiPartFormDataCompliance to RFC7578 due to {}. This exception is ignored.",
- e.getMessage(), e);
- }
-
return camelServlet;
}
@@ -1344,7 +1333,7 @@ public abstract class JettyHttpComponent extends HttpCommonComponent
try {
Object o = getContainer(server);
- o.getClass().getMethod("addEventListener", Container.Listener.class).invoke(o, mbContainer);
+ o.getClass().getMethod("addEventListener", EventListener.class).invoke(o, mbContainer);
mbContainer.getClass().getMethod("beanAdded", Container.class, Object.class)
.invoke(mbContainer, null, server);
} catch (RuntimeException rex) {
diff --git a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/MultiPartFilter.java b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/MultiPartFilter.java
index fd03e944f8e..e9314ae4a46 100644
--- a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/MultiPartFilter.java
+++ b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/MultiPartFilter.java
@@ -28,7 +28,7 @@ import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
/**
- * To enable handle attachments with Jetty 9 when this filter is set.
+ * To enable handle attachments with Jetty 11 when this filter is set.
* <p/>
* To replace the deprecated org.eclipse.jetty.servlets.MultiPartFilter Tell AttachmentHttpBinding to use Servlet 3
* HttpServletRequest.getParts API
diff --git a/components/camel-jetty/src/generated/java/org/apache/camel/component/jetty9/JettyHttp9EndpointUriFactory.java b/components/camel-jetty/src/generated/java/org/apache/camel/component/jetty11/JettyHttp11EndpointUriFactory.java
similarity index 94%
rename from components/camel-jetty/src/generated/java/org/apache/camel/component/jetty9/JettyHttp9EndpointUriFactory.java
rename to components/camel-jetty/src/generated/java/org/apache/camel/component/jetty11/JettyHttp11EndpointUriFactory.java
index f5efcfcb92b..3719fa36932 100644
--- a/components/camel-jetty/src/generated/java/org/apache/camel/component/jetty9/JettyHttp9EndpointUriFactory.java
+++ b/components/camel-jetty/src/generated/java/org/apache/camel/component/jetty11/JettyHttp11EndpointUriFactory.java
@@ -1,5 +1,5 @@
/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.jetty9;
+package org.apache.camel.component.jetty11;
import java.net.URISyntaxException;
import java.util.Collections;
@@ -13,7 +13,7 @@ import org.apache.camel.spi.EndpointUriFactory;
/**
* Generated by camel build tools - do NOT edit this file!
*/
-public class JettyHttp9EndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory {
+public class JettyHttp11EndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory {
private static final String BASE = ":httpUri";
diff --git a/components/camel-jetty/src/generated/java/org/apache/camel/component/jetty9/JettyHttpComponent9Configurer.java b/components/camel-jetty/src/generated/java/org/apache/camel/component/jetty11/JettyHttpComponent11Configurer.java
similarity index 96%
rename from components/camel-jetty/src/generated/java/org/apache/camel/component/jetty9/JettyHttpComponent9Configurer.java
rename to components/camel-jetty/src/generated/java/org/apache/camel/component/jetty11/JettyHttpComponent11Configurer.java
index 8211d97dbd2..05c18e26a37 100644
--- a/components/camel-jetty/src/generated/java/org/apache/camel/component/jetty9/JettyHttpComponent9Configurer.java
+++ b/components/camel-jetty/src/generated/java/org/apache/camel/component/jetty11/JettyHttpComponent11Configurer.java
@@ -1,25 +1,20 @@
/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.jetty9;
-
-import java.util.Map;
+package org.apache.camel.component.jetty11;
import org.apache.camel.CamelContext;
-import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
import org.apache.camel.spi.PropertyConfigurerGetter;
-import org.apache.camel.spi.ConfigurerStrategy;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
-import org.apache.camel.util.CaseInsensitiveMap;
import org.apache.camel.support.component.PropertyConfigurerSupport;
/**
* Generated by camel build tools - do NOT edit this file!
*/
@SuppressWarnings("unchecked")
-public class JettyHttpComponent9Configurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+public class JettyHttpComponent11Configurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
@Override
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
- JettyHttpComponent9 target = (JettyHttpComponent9) obj;
+ JettyHttpComponent11 target = (JettyHttpComponent11) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "allowjavaserializedobject":
case "allowJavaSerializedObject": target.setAllowJavaSerializedObject(property(camelContext, boolean.class, value)); return true;
@@ -164,7 +159,7 @@ public class JettyHttpComponent9Configurer extends PropertyConfigurerSupport imp
@Override
public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
- JettyHttpComponent9 target = (JettyHttpComponent9) obj;
+ JettyHttpComponent11 target = (JettyHttpComponent11) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "allowjavaserializedobject":
case "allowJavaSerializedObject": return target.isAllowJavaSerializedObject();
diff --git a/components/camel-jetty/src/generated/java/org/apache/camel/component/jetty9/JettyHttpEndpoint9Configurer.java b/components/camel-jetty/src/generated/java/org/apache/camel/component/jetty11/JettyHttpEndpoint11Configurer.java
similarity index 96%
rename from components/camel-jetty/src/generated/java/org/apache/camel/component/jetty9/JettyHttpEndpoint9Configurer.java
rename to components/camel-jetty/src/generated/java/org/apache/camel/component/jetty11/JettyHttpEndpoint11Configurer.java
index 104821f1cb9..feda3ea6d58 100644
--- a/components/camel-jetty/src/generated/java/org/apache/camel/component/jetty9/JettyHttpEndpoint9Configurer.java
+++ b/components/camel-jetty/src/generated/java/org/apache/camel/component/jetty11/JettyHttpEndpoint11Configurer.java
@@ -1,25 +1,20 @@
/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.jetty9;
-
-import java.util.Map;
+package org.apache.camel.component.jetty11;
import org.apache.camel.CamelContext;
-import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
import org.apache.camel.spi.PropertyConfigurerGetter;
-import org.apache.camel.spi.ConfigurerStrategy;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
-import org.apache.camel.util.CaseInsensitiveMap;
import org.apache.camel.support.component.PropertyConfigurerSupport;
/**
* Generated by camel build tools - do NOT edit this file!
*/
@SuppressWarnings("unchecked")
-public class JettyHttpEndpoint9Configurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+public class JettyHttpEndpoint11Configurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
@Override
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
- JettyHttpEndpoint9 target = (JettyHttpEndpoint9) obj;
+ JettyHttpEndpoint11 target = (JettyHttpEndpoint11) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "async": target.setAsync(property(camelContext, boolean.class, value)); return true;
case "bridgeerrorhandler":
@@ -154,7 +149,7 @@ public class JettyHttpEndpoint9Configurer extends PropertyConfigurerSupport impl
@Override
public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
- JettyHttpEndpoint9 target = (JettyHttpEndpoint9) obj;
+ JettyHttpEndpoint11 target = (JettyHttpEndpoint11) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "async": return target.isAsync();
case "bridgeerrorhandler":
diff --git a/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/component/jetty b/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/component/jetty
index 18fd1ba8f0f..f9173c15d3b 100644
--- a/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/component/jetty
+++ b/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/component/jetty
@@ -1,2 +1,2 @@
# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.jetty9.JettyHttpComponent9
+class=org.apache.camel.component.jetty11.JettyHttpComponent11
diff --git a/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/configurer/jetty-component b/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/configurer/jetty-component
index 1f0792cf87c..8f8c8ce9386 100644
--- a/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/configurer/jetty-component
+++ b/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/configurer/jetty-component
@@ -1,2 +1,2 @@
# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.jetty9.JettyHttpComponent9Configurer
+class=org.apache.camel.component.jetty11.JettyHttpComponent11Configurer
diff --git a/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/configurer/jetty-endpoint b/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/configurer/jetty-endpoint
index d8a0689b558..d12e3c31a80 100644
--- a/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/configurer/jetty-endpoint
+++ b/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/configurer/jetty-endpoint
@@ -1,2 +1,2 @@
# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.jetty9.JettyHttpEndpoint9Configurer
+class=org.apache.camel.component.jetty11.JettyHttpEndpoint11Configurer
diff --git a/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/send-dynamic/jetty b/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/send-dynamic/jetty
index ca555990bee..d8f7c765168 100644
--- a/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/send-dynamic/jetty
+++ b/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/send-dynamic/jetty
@@ -1,2 +1,2 @@
# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.jetty9.HttpSendDynamicAware
+class=org.apache.camel.component.jetty11.HttpSendDynamicAware
diff --git a/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/urifactory/jetty-endpoint b/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/urifactory/jetty-endpoint
index c66b1220ece..d5b6af1a82f 100644
--- a/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/urifactory/jetty-endpoint
+++ b/components/camel-jetty/src/generated/resources/META-INF/services/org/apache/camel/urifactory/jetty-endpoint
@@ -1,2 +1,2 @@
# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.jetty9.JettyHttp9EndpointUriFactory
+class=org.apache.camel.component.jetty11.JettyHttp11EndpointUriFactory
diff --git a/components/camel-jetty/src/generated/resources/org/apache/camel/component/jetty9/jetty.json b/components/camel-jetty/src/generated/resources/org/apache/camel/component/jetty11/jetty.json
similarity index 99%
rename from components/camel-jetty/src/generated/resources/org/apache/camel/component/jetty9/jetty.json
rename to components/camel-jetty/src/generated/resources/org/apache/camel/component/jetty11/jetty.json
index 932d1f3b777..a6c2e50f019 100644
--- a/components/camel-jetty/src/generated/resources/org/apache/camel/component/jetty9/jetty.json
+++ b/components/camel-jetty/src/generated/resources/org/apache/camel/component/jetty11/jetty.json
@@ -3,12 +3,12 @@
"kind": "component",
"name": "jetty",
"title": "Jetty",
- "description": "Expose HTTP endpoints using Jetty 9.",
+ "description": "Expose HTTP endpoints using Jetty 11.",
"deprecated": false,
"deprecationNote": "",
"firstVersion": "1.2.0",
"label": "http",
- "javaType": "org.apache.camel.component.jetty9.JettyHttpComponent9",
+ "javaType": "org.apache.camel.component.jetty11.JettyHttpComponent11",
"supportLevel": "Stable",
"groupId": "org.apache.camel",
"artifactId": "camel-jetty",
diff --git a/components/camel-jetty/src/main/docs/jetty-component.adoc b/components/camel-jetty/src/main/docs/jetty-component.adoc
index 90ae00c0dae..f9bebc9f477 100644
--- a/components/camel-jetty/src/main/docs/jetty-component.adoc
+++ b/components/camel-jetty/src/main/docs/jetty-component.adoc
@@ -2,7 +2,7 @@
:doctitle: Jetty
:shortname: jetty
:artifactid: camel-jetty
-:description: Expose HTTP endpoints using Jetty 9.
+:description: Expose HTTP endpoints using Jetty 11.
:since: 1.2
:supportlevel: Stable
:component-header: Only consumer is supported
@@ -496,7 +496,7 @@ from("jetty:http://0.0.0.0:9080/myservice?handlers=securityHandler")
If you need more handlers, set the `handlers` option equal to a
comma-separated list of bean IDs.
-Blueprint based definition of basic authentication (based on Jetty 9):
+Blueprint based definition of basic authentication (based on Jetty 11):
[source,xml]
----
diff --git a/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java b/components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/AttachmentHttpBinding.java
similarity index 94%
rename from components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java
rename to components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/AttachmentHttpBinding.java
index bfb5288ac61..76bc38275d6 100644
--- a/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java
+++ b/components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/AttachmentHttpBinding.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.jetty9;
+package org.apache.camel.component.jetty11;
import java.io.IOException;
import java.io.InputStream;
@@ -37,13 +37,14 @@ import org.apache.camel.component.jetty.MultiPartFilter;
import org.apache.camel.http.common.DefaultHttpBinding;
import org.apache.camel.http.common.HttpHelper;
import org.apache.camel.http.common.HttpMessage;
+import org.eclipse.jetty.http.HttpFields;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * To handle attachments with Jetty 9.
+ * To handle attachments with Jetty 11.
* <p/>
- * This implementation is needed to deal with attachments when using Jetty 9.
+ * This implementation is needed to deal with attachments when using Jetty 11.
*/
final class AttachmentHttpBinding extends DefaultHttpBinding {
private static final Logger LOG = LoggerFactory.getLogger(AttachmentHttpBinding.class);
@@ -92,7 +93,9 @@ final class AttachmentHttpBinding extends DefaultHttpBinding {
// remove Content-Encoding from request
if (request instanceof org.eclipse.jetty.server.Request) {
org.eclipse.jetty.server.Request jettyRequest = (org.eclipse.jetty.server.Request) request;
- jettyRequest.getHttpFields().remove(Exchange.CONTENT_ENCODING);
+ HttpFields originalFields = jettyRequest.getHttpFields();
+ HttpFields newFields = HttpFields.build(originalFields).remove(Exchange.CONTENT_ENCODING);
+ jettyRequest.setHttpFields(newFields);
}
// attachment is optional
diff --git a/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/CamelInputStreamContentProvider.java b/components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/CamelInputStreamContentProvider.java
similarity index 96%
rename from components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/CamelInputStreamContentProvider.java
rename to components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/CamelInputStreamContentProvider.java
index 1b1cf7ea4a9..9f00e15d100 100644
--- a/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/CamelInputStreamContentProvider.java
+++ b/components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/CamelInputStreamContentProvider.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.jetty9;
+package org.apache.camel.component.jetty11;
import java.io.InputStream;
diff --git a/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/HttpSendDynamicAware.java b/components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/HttpSendDynamicAware.java
similarity index 95%
rename from components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/HttpSendDynamicAware.java
rename to components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/HttpSendDynamicAware.java
index eee06bc1e06..66572c26318 100644
--- a/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/HttpSendDynamicAware.java
+++ b/components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/HttpSendDynamicAware.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.jetty9;
+package org.apache.camel.component.jetty11;
import org.apache.camel.spi.annotations.SendDynamic;
diff --git a/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/JettyContentExchange9.java b/components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/JettyContentExchange11.java
similarity index 98%
rename from components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/JettyContentExchange9.java
rename to components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/JettyContentExchange11.java
index 2ca5924fc18..f03b5724e34 100644
--- a/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/JettyContentExchange9.java
+++ b/components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/JettyContentExchange11.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.jetty9;
+package org.apache.camel.component.jetty11;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
@@ -55,9 +55,9 @@ import org.slf4j.LoggerFactory;
/**
* Jetty specific exchange which keeps track of the request and response.
*/
-public class JettyContentExchange9 implements JettyContentExchange {
+public class JettyContentExchange11 implements JettyContentExchange {
- private static final Logger LOG = LoggerFactory.getLogger(JettyContentExchange9.class);
+ private static final Logger LOG = LoggerFactory.getLogger(JettyContentExchange11.class);
private volatile Exchange exchange;
private volatile AsyncCallback callback;
diff --git a/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/JettyHttpComponent9.java b/components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/JettyHttpComponent11.java
similarity index 96%
rename from components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/JettyHttpComponent9.java
rename to components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/JettyHttpComponent11.java
index d7ef71f8962..a26829a0578 100644
--- a/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/JettyHttpComponent9.java
+++ b/components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/JettyHttpComponent11.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.jetty9;
+package org.apache.camel.component.jetty11;
import java.net.URI;
import java.net.URISyntaxException;
@@ -40,20 +40,20 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Component("jetty")
-public class JettyHttpComponent9 extends JettyHttpComponent {
+public class JettyHttpComponent11 extends JettyHttpComponent {
public static Map<String, Throwable> connectorCreation = new ConcurrentHashMap<>();
- private static final Logger LOG = LoggerFactory.getLogger(JettyHttpComponent9.class);
+ private static final Logger LOG = LoggerFactory.getLogger(JettyHttpComponent11.class);
@Override
protected JettyHttpEndpoint createEndpoint(URI endpointUri, URI httpUri) throws URISyntaxException {
- return new JettyHttpEndpoint9(this, endpointUri.toString(), httpUri);
+ return new JettyHttpEndpoint11(this, endpointUri.toString(), httpUri);
}
@Override
protected AbstractConnector createConnectorJettyInternal(
- Server server, JettyHttpEndpoint endpoint, SslContextFactory sslcf) {
+ Server server, JettyHttpEndpoint endpoint, SslContextFactory.Server sslcf) {
try {
String host = endpoint.getHttpUri().getHost();
int port = endpoint.getPort();
diff --git a/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/JettyHttpEndpoint9.java b/components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/JettyHttpEndpoint11.java
similarity index 88%
rename from components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/JettyHttpEndpoint9.java
rename to components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/JettyHttpEndpoint11.java
index 52157b962bc..f7de2a08099 100644
--- a/components/camel-jetty/src/main/java/org/apache/camel/component/jetty9/JettyHttpEndpoint9.java
+++ b/components/camel-jetty/src/main/java/org/apache/camel/component/jetty11/JettyHttpEndpoint11.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.jetty9;
+package org.apache.camel.component.jetty11;
import java.net.URI;
import java.net.URISyntaxException;
@@ -30,24 +30,24 @@ import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriEndpoint;
/**
- * Expose HTTP endpoints using Jetty 9.
+ * Expose HTTP endpoints using Jetty 11.
*/
@UriEndpoint(firstVersion = "1.2.0", scheme = "jetty", extendsScheme = "http", title = "Jetty", syntax = "jetty:httpUri",
category = { Category.HTTP }, consumerOnly = true, lenientProperties = true,
headersClass = JettyHttpConstants.class)
@Metadata(excludeProperties = "authMethod,authMethodPriority,authUsername,authPassword,authDomain,authHost"
+ "proxyAuthScheme,proxyAuthMethod,proxyAuthUsername,proxyAuthPassword,proxyAuthHost,proxyAuthPort,proxyAuthDomain")
-public class JettyHttpEndpoint9 extends JettyHttpEndpoint implements AsyncEndpoint {
+public class JettyHttpEndpoint11 extends JettyHttpEndpoint implements AsyncEndpoint {
private HttpBinding binding;
- public JettyHttpEndpoint9(JettyHttpComponent component, String uri, URI httpURL) throws URISyntaxException {
+ public JettyHttpEndpoint11(JettyHttpComponent component, String uri, URI httpURL) throws URISyntaxException {
super(component, uri, httpURL);
}
@Override
public HttpBinding getHttpBinding() {
- // make sure we include jetty9 variant of the http binding
+ // make sure we include jetty10 variant of the http binding
if (this.binding == null) {
this.binding = new AttachmentHttpBinding();
this.binding.setTransferException(isTransferException());
@@ -72,6 +72,6 @@ public class JettyHttpEndpoint9 extends JettyHttpEndpoint implements AsyncEndpoi
@Override
public JettyContentExchange createContentExchange() {
- return new JettyContentExchange9();
+ return new JettyContentExchange11();
}
}
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyComponentMuteExceptionTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyComponentMuteExceptionTest.java
index 509587b1e13..668a7dfbe04 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyComponentMuteExceptionTest.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyComponentMuteExceptionTest.java
@@ -17,7 +17,7 @@
package org.apache.camel.component.jetty;
import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.jetty9.JettyHttpComponent9;
+import org.apache.camel.component.jetty11.JettyHttpComponent11;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
@@ -48,8 +48,8 @@ public class JettyComponentMuteExceptionTest extends BaseJettyTest {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
@Override
- public void configure() {
- JettyHttpComponent9 jc = context.getComponent("jetty", JettyHttpComponent9.class);
+ public void configure() throws Exception {
+ JettyHttpComponent11 jc = context.getComponent("jetty", JettyHttpComponent11.class);
jc.setMuteException(true);
from("jetty:http://localhost:{{port}}/foo").to("mock:destination")
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpEndpointDisconnectTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpEndpointDisconnectTest.java
index 258f2a329e1..319ea1da8eb 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpEndpointDisconnectTest.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyHttpEndpointDisconnectTest.java
@@ -20,8 +20,7 @@ import java.io.PrintWriter;
import java.io.StringWriter;
import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.jetty9.JettyHttpComponent9;
-import org.eclipse.jetty.util.Jetty;
+import org.apache.camel.component.jetty11.JettyHttpComponent11;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Isolated;
@@ -42,7 +41,7 @@ public class JettyHttpEndpointDisconnectTest extends BaseJettyTest {
() -> {
StringBuilder sb = new StringBuilder("Connector should have been removed\n");
for (String key : JettyHttpComponent.CONNECTORS.keySet()) {
- Throwable t = JettyHttpComponent9.connectorCreation.get(key);
+ Throwable t = JettyHttpComponent11.connectorCreation.get(key);
if (t == null) {
t = new Throwable("Unable to find connector creation");
}
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/TwoCamelContextWithJettyRouteTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/TwoCamelContextWithJettyRouteTest.java
index 1461cef7330..af86ce4f996 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/TwoCamelContextWithJettyRouteTest.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/TwoCamelContextWithJettyRouteTest.java
@@ -37,9 +37,9 @@ public class TwoCamelContextWithJettyRouteTest extends BaseJettyTest {
CamelContext contextB = new DefaultCamelContext();
contextB.addRoutes(new RouteBuilder() {
@Override
- public void configure() {
+ public void configure() throws Exception {
from("jetty://http://localhost:" + port2 + "/myotherapp").process(new Processor() {
- public void process(Exchange exchange) {
+ public void process(Exchange exchange) throws Exception {
String in = exchange.getIn().getBody(String.class);
exchange.getMessage().setBody("Hi " + in);
}
@@ -65,16 +65,16 @@ public class TwoCamelContextWithJettyRouteTest extends BaseJettyTest {
}
@Override
- protected RouteBuilder createRouteBuilder() {
+ protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
- public void configure() {
+ public void configure() throws Exception {
from("direct:a").to("http://localhost:" + port1 + "/myapp");
from("direct:b").to("http://localhost:" + port2 + "/myotherapp");
from("jetty://http://localhost:" + port1 + "/myapp").process(new Processor() {
- public void process(Exchange exchange) {
+ public void process(Exchange exchange) throws Exception {
String in = exchange.getIn().getBody(String.class);
exchange.getMessage().setBody("Bye " + in);
}
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/async/JettyAsyncContinuationTimeoutTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/async/JettyAsyncContinuationTimeoutTest.java
index 4b09b772b9b..5afab1f976b 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/async/JettyAsyncContinuationTimeoutTest.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/async/JettyAsyncContinuationTimeoutTest.java
@@ -49,7 +49,7 @@ public class JettyAsyncContinuationTimeoutTest extends BaseJettyTest {
long taken = watch.taken();
HttpOperationFailedException cause = assertIsInstanceOf(HttpOperationFailedException.class, e.getCause());
- assertEquals(504, cause.getStatusCode());
+ assertEquals(500, cause.getStatusCode());
// should be approx 3-4 sec.
assertTrue(taken < 4500, "Timeout should occur faster than " + taken);
diff --git a/components/camel-jetty/src/test/resources/org/apache/camel/component/jetty/JettyComponentSpringConfiguredTest.xml b/components/camel-jetty/src/test/resources/org/apache/camel/component/jetty/JettyComponentSpringConfiguredTest.xml
index a67186f1068..28dea64c3df 100644
--- a/components/camel-jetty/src/test/resources/org/apache/camel/component/jetty/JettyComponentSpringConfiguredTest.xml
+++ b/components/camel-jetty/src/test/resources/org/apache/camel/component/jetty/JettyComponentSpringConfiguredTest.xml
@@ -24,7 +24,7 @@
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">
- <bean id="jetty2" class="org.apache.camel.component.jetty9.JettyHttpComponent9">
+ <bean id="jetty2" class="org.apache.camel.component.jetty11.JettyHttpComponent11">
<property name="enableJmx" value="true"/>
<property name="minThreads" value="10"/>
<property name="maxThreads" value="50"/>
diff --git a/components/camel-jetty/src/test/resources/org/apache/camel/component/jetty/jetty-https.xml b/components/camel-jetty/src/test/resources/org/apache/camel/component/jetty/jetty-https.xml
index 1228a21ae06..e57e1646c5c 100644
--- a/components/camel-jetty/src/test/resources/org/apache/camel/component/jetty/jetty-https.xml
+++ b/components/camel-jetty/src/test/resources/org/apache/camel/component/jetty/jetty-https.xml
@@ -23,7 +23,7 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">
- <bean id="jetty" class="org.apache.camel.component.jetty9.JettyHttpComponent9">
+ <bean id="jetty" class="org.apache.camel.component.jetty11.JettyHttpComponent11">
<property name="sslPassword" value="changeit"/>
<property name="sslKeyPassword" value="changeit"/>
<property name="keystore" value="src/test/resources/jsse/localhost.p12"/>
diff --git a/components/camel-tracing/src/main/java/org/apache/camel/tracing/decorators/JettySpanDecorator.java b/components/camel-tracing/src/main/java/org/apache/camel/tracing/decorators/JettySpanDecorator.java
index 94a418a60a3..92b4837412f 100644
--- a/components/camel-tracing/src/main/java/org/apache/camel/tracing/decorators/JettySpanDecorator.java
+++ b/components/camel-tracing/src/main/java/org/apache/camel/tracing/decorators/JettySpanDecorator.java
@@ -25,7 +25,7 @@ public class JettySpanDecorator extends AbstractHttpSpanDecorator {
@Override
public String getComponentClassName() {
- return "org.apache.camel.component.jetty9.JettyHttpComponent9";
+ return "org.apache.camel.component.jetty10.JettyHttpComponent10";
}
}
diff --git a/components/camel-websocket/src/main/java/org/apache/camel/component/websocket/WebsocketComponent.java b/components/camel-websocket/src/main/java/org/apache/camel/component/websocket/WebsocketComponent.java
index 16b874a32f8..ae7c5772962 100644
--- a/components/camel-websocket/src/main/java/org/apache/camel/component/websocket/WebsocketComponent.java
+++ b/components/camel-websocket/src/main/java/org/apache/camel/component/websocket/WebsocketComponent.java
@@ -470,7 +470,7 @@ public class WebsocketComponent extends DefaultComponent implements SSLContextPa
servlets.put(pathSpec, servlet);
ServletHolder servletHolder = new ServletHolder(servlet);
servletHolder.getInitParameters().putAll(handler.getInitParams());
- // Jetty 9 parameter bufferSize is now inputBufferSize
+ // Jetty 11 parameter bufferSize is now inputBufferSize
servletHolder.setInitParameter("inputBufferSize", handler.getInitParameter("bufferSize"));
handler.addServlet(servletHolder, pathSpec);
return servlet;
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
index a6ce9cb7486..ab43a70c3fe 100644
--- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
@@ -2360,7 +2360,7 @@ public interface ComponentsBuilderFactory {
}
/**
* Jetty (camel-jetty)
- * Expose HTTP endpoints using Jetty 9.
+ * Expose HTTP endpoints using Jetty 11.
*
* Category: http
* Since: 1.2
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JettyComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JettyComponentBuilderFactory.java
index 41ef2d79a1c..f124a1e96bd 100644
--- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JettyComponentBuilderFactory.java
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/JettyComponentBuilderFactory.java
@@ -20,10 +20,10 @@ import javax.annotation.processing.Generated;
import org.apache.camel.Component;
import org.apache.camel.builder.component.AbstractComponentBuilder;
import org.apache.camel.builder.component.ComponentBuilder;
-import org.apache.camel.component.jetty9.JettyHttpComponent9;
+import org.apache.camel.component.jetty11.JettyHttpComponent11;
/**
- * Expose HTTP endpoints using Jetty 9.
+ * Expose HTTP endpoints using Jetty 11.
*
* Generated by camel-package-maven-plugin - do not edit this file!
*/
@@ -32,7 +32,7 @@ public interface JettyComponentBuilderFactory {
/**
* Jetty (camel-jetty)
- * Expose HTTP endpoints using Jetty 9.
+ * Expose HTTP endpoints using Jetty 11.
*
* Category: http
* Since: 1.2
diff --git a/dsl/camel-componentdsl/src/generated/resources/metadata.json b/dsl/camel-componentdsl/src/generated/resources/metadata.json
index da8fe81bb01..69c92b818ac 100644
--- a/dsl/camel-componentdsl/src/generated/resources/metadata.json
+++ b/dsl/camel-componentdsl/src/generated/resources/metadata.json
@@ -3865,7 +3865,7 @@
"kind": "component",
"name": "jetty",
"title": "Jetty",
- "description": "Expose HTTP endpoints using Jetty 9.",
+ "description": "Expose HTTP endpoints using Jetty 11.",
"deprecated": false,
"deprecationNote": "",
"firstVersion": "1.2.0",
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index 96c6c54d090..7a64a96ad91 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -7989,7 +7989,7 @@ public class StaticEndpointBuilders {
}
/**
* Jetty (camel-jetty)
- * Expose HTTP endpoints using Jetty 9.
+ * Expose HTTP endpoints using Jetty 11.
*
* Category: http
* Since: 1.2
@@ -8009,7 +8009,7 @@ public class StaticEndpointBuilders {
}
/**
* Jetty (camel-jetty)
- * Expose HTTP endpoints using Jetty 9.
+ * Expose HTTP endpoints using Jetty 11.
*
* Category: http
* Since: 1.2
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JettyHttpEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JettyHttpEndpointBuilderFactory.java
index d8e0a069a4e..28bd2590862 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JettyHttpEndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/JettyHttpEndpointBuilderFactory.java
@@ -27,7 +27,7 @@ import org.apache.camel.builder.EndpointProducerBuilder;
import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
/**
- * Expose HTTP endpoints using Jetty 9.
+ * Expose HTTP endpoints using Jetty 11.
*
* Generated by camel build tools - do NOT edit this file!
*/
@@ -1218,7 +1218,7 @@ public interface JettyHttpEndpointBuilderFactory {
public interface JettyHttpBuilders {
/**
* Jetty (camel-jetty)
- * Expose HTTP endpoints using Jetty 9.
+ * Expose HTTP endpoints using Jetty 11.
*
* Category: http
* Since: 1.2
@@ -1231,7 +1231,7 @@ public interface JettyHttpEndpointBuilderFactory {
}
/**
* Jetty (camel-jetty)
- * Expose HTTP endpoints using Jetty 9.
+ * Expose HTTP endpoints using Jetty 11.
*
* Category: http
* Since: 1.2
@@ -1250,7 +1250,7 @@ public interface JettyHttpEndpointBuilderFactory {
}
/**
* Jetty (camel-jetty)
- * Expose HTTP endpoints using Jetty 9.
+ * Expose HTTP endpoints using Jetty 11.
*
* Category: http
* Since: 1.2
diff --git a/test-infra/camel-test-infra-jetty/src/test/java/org/apache/camel/test/infra/jetty/services/JettyEmbeddedService.java b/test-infra/camel-test-infra-jetty/src/test/java/org/apache/camel/test/infra/jetty/services/JettyEmbeddedService.java
index bffe10568bd..9dade4d1621 100644
--- a/test-infra/camel-test-infra-jetty/src/test/java/org/apache/camel/test/infra/jetty/services/JettyEmbeddedService.java
+++ b/test-infra/camel-test-infra-jetty/src/test/java/org/apache/camel/test/infra/jetty/services/JettyEmbeddedService.java
@@ -54,7 +54,7 @@ public class JettyEmbeddedService implements JettyService, BeforeEachCallback, A
ServerConnector connector;
SSLContext sslContext = jettyConfiguration.getSslContext();
if (sslContext != null) {
- SslContextFactory sslContextFactory = new SslContextFactory.Server();
+ SslContextFactory.Server sslContextFactory = new SslContextFactory.Server();
sslContextFactory.setSslContext(sslContext);
connector = new ServerConnector(server, new SslConnectionFactory(sslContextFactory, null));