Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/jetty-12.0.x' into jetty-12.0.…
Browse files Browse the repository at this point in the history
…x-documentation-operations-logging

* upstream/jetty-12.0.x: (42 commits)
  fixed style
  cleanup TODOs for decoration
  Issue jetty#9300 - Rename RetainableByteBufferPool to ByteBufferPool
  Removed TODOs that will not be done.
  Rename Handler Nested & Collection (jetty#9305)
  fix surefire jpms configuration
  fix merge
  fix merge
  Bump maven.surefire.plugin.version from 3.0.0-M5 to 3.0.0-M8 (jetty#9255)
  Rename RetainableByteBufferPool to ByteBufferPool
  Fixed merge
  Fix jetty#9285 use possibly wrapper response for redirection (jetty#9286)
  Issue jetty#9293 - Jetty 12 - Relax JPMS dependencies (quic) (jetty#9307)
  Issue jetty#9293 - Jetty 12 - Relax JPMS dependencies (fcgi) (jetty#9306)
  Jetty 10 - Configurable Unsafe Host Header (jetty#9283)
  Issue jetty#9293 - Jetty 12 - Relax JPMS dependencies. (jetty#9296)
  Issue jetty#9293 - Jetty 12 - Relax JPMS dependencies. (jetty#9299)
  fix dependency
  add used dependency
  this dependency is used in test scope
  ...
  • Loading branch information
Greg Poulos committed Feb 6, 2023
2 parents 7e21247 + d901237 commit 1e808d5
Show file tree
Hide file tree
Showing 638 changed files with 3,982 additions and 3,744 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The `ClientConnector` primarily wraps the link:{javadoc-url}/org/eclipse/jetty/i

* a thread pool (in form of an `java.util.concurrent.Executor`)
* a scheduler (in form of `org.eclipse.jetty.util.thread.Scheduler`)
* a byte buffer pool (in form of `org.eclipse.jetty.io.RetainableByteBufferPool`)
* a byte buffer pool (in form of `org.eclipse.jetty.io.ByteBufferPool`)
* a TLS factory (in form of `org.eclipse.jetty.util.ssl.SslContextFactory.Client`)

The `ClientConnector` is where you want to set those components after you have configured them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ public void writeLine(String line, Callback callback)

// Wrap the "telnet" ClientConnectionFactory with the SslClientConnectionFactory.
connectionFactory = new SslClientConnectionFactory(clientConnector.getSslContextFactory(),
clientConnector.getRetainableByteBufferPool(), clientConnector.getExecutor(), connectionFactory);
clientConnector.getByteBufferPool(), clientConnector.getExecutor(), connectionFactory);

// We will obtain a SslConnection now.
CompletableFuture<SslConnection> connectionPromise = new Promise.Completable<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.eclipse.jetty.http.HttpURI;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.http.MetaData;
import org.eclipse.jetty.http2.ErrorCode;
import org.eclipse.jetty.http2.api.Session;
import org.eclipse.jetty.http2.api.Stream;
import org.eclipse.jetty.http2.client.HTTP2Client;
Expand All @@ -34,7 +35,6 @@
import org.eclipse.jetty.http2.frames.PushPromiseFrame;
import org.eclipse.jetty.http2.frames.ResetFrame;
import org.eclipse.jetty.http2.frames.SettingsFrame;
import org.eclipse.jetty.http2.internal.ErrorCode;
import org.eclipse.jetty.io.ClientConnector;
import org.eclipse.jetty.util.Callback;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
import org.eclipse.jetty.http.HttpURI;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.http.MetaData;
import org.eclipse.jetty.http3.HTTP3ErrorCode;
import org.eclipse.jetty.http3.api.Session;
import org.eclipse.jetty.http3.api.Stream;
import org.eclipse.jetty.http3.client.HTTP3Client;
import org.eclipse.jetty.http3.frames.DataFrame;
import org.eclipse.jetty.http3.frames.HeadersFrame;
import org.eclipse.jetty.http3.internal.HTTP3ErrorCode;

import static java.lang.System.Logger.Level.INFO;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public boolean process(Request request, Response response, Callback callback)
}
}

public static class RootHandler extends Handler.Collection
public static class RootHandler extends Handler.Sequence
{
@Override
public boolean process(Request request, Response response, Callback callback) throws Exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,11 @@ public boolean process(Request request, Response response, Callback callback) th
GzipHandler gzipHandler = new GzipHandler();
server.setHandler(gzipHandler);

Handler.Collection collection = new Handler.Collection();
gzipHandler.setHandler(collection);
Handler.Sequence sequence = new Handler.Sequence();
gzipHandler.setHandler(sequence);

collection.addHandler(new App1Handler());
collection.addHandler(new App2Handler());
sequence.addHandler(new App1Handler());
sequence.addHandler(new App2Handler());
// end::handlerTree[]
}

Expand Down Expand Up @@ -583,7 +583,7 @@ public boolean process(Request request, Response response, Callback callback)
}

// tag::handlerFilter[]
class FilterHandler extends Handler.Wrapper
class FilterHandler extends Handler.BaseWrapper
{
@Override
public boolean process(Request request, Response response, Callback callback) throws Exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.eclipse.jetty.http.HttpURI;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.http.MetaData;
import org.eclipse.jetty.http2.ErrorCode;
import org.eclipse.jetty.http2.api.Session;
import org.eclipse.jetty.http2.api.Stream;
import org.eclipse.jetty.http2.api.server.ServerSessionListener;
Expand All @@ -32,7 +33,6 @@
import org.eclipse.jetty.http2.frames.PushPromiseFrame;
import org.eclipse.jetty.http2.frames.ResetFrame;
import org.eclipse.jetty.http2.frames.SettingsFrame;
import org.eclipse.jetty.http2.internal.ErrorCode;
import org.eclipse.jetty.http2.server.RawHTTP2ServerConnectionFactory;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.http.MetaData;
import org.eclipse.jetty.http3.HTTP3ErrorCode;
import org.eclipse.jetty.http3.api.Session;
import org.eclipse.jetty.http3.api.Stream;
import org.eclipse.jetty.http3.frames.DataFrame;
import org.eclipse.jetty.http3.frames.HeadersFrame;
import org.eclipse.jetty.http3.internal.HTTP3ErrorCode;
import org.eclipse.jetty.http3.server.HTTP3ServerConnector;
import org.eclipse.jetty.http3.server.RawHTTP3ServerConnectionFactory;
import org.eclipse.jetty.server.Server;
Expand Down
6 changes: 1 addition & 5 deletions jetty-core/jetty-client/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@
requires static java.management;
// Only required if using SPNEGO.
requires static java.security.jgss;
// Only required if using JMX.
requires static org.eclipse.jetty.jmx;

exports org.eclipse.jetty.client;
exports org.eclipse.jetty.client.transport;

exports org.eclipse.jetty.client.jmx to
org.eclipse.jetty.jmx;

exports org.eclipse.jetty.client.internal to
org.eclipse.jetty.fcgi.client,
org.eclipse.jetty.http2.client.transport,
org.eclipse.jetty.http3.client.transport;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

import org.eclipse.jetty.client.internal.HttpDestination;
import org.eclipse.jetty.client.transport.HttpDestination;
import org.eclipse.jetty.util.Attachable;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.NanoTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.Map;
import java.util.Objects;

import org.eclipse.jetty.client.internal.HttpDestination;
import org.eclipse.jetty.client.transport.HttpDestination;
import org.eclipse.jetty.io.ClientConnector;
import org.eclipse.jetty.util.Promise;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
Expand Down Expand Up @@ -52,7 +52,7 @@ protected void doStart() throws Exception
{
HttpClient httpClient = getHttpClient();
connector.setBindAddress(httpClient.getBindAddress());
connector.setRetainableByteBufferPool(httpClient.getRetainableByteBufferPool());
connector.setByteBufferPool(httpClient.getByteBufferPool());
connector.setConnectBlocking(httpClient.isConnectBlocking());
connector.setConnectTimeout(Duration.ofMillis(httpClient.getConnectTimeout()));
connector.setExecutor(httpClient.getExecutor());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

import org.eclipse.jetty.client.Authentication.HeaderInfo;
import org.eclipse.jetty.client.internal.HttpContentResponse;
import org.eclipse.jetty.client.internal.HttpConversation;
import org.eclipse.jetty.client.internal.HttpRequest;
import org.eclipse.jetty.client.internal.ResponseNotifier;
import org.eclipse.jetty.client.transport.HttpConversation;
import org.eclipse.jetty.client.transport.HttpRequest;
import org.eclipse.jetty.client.transport.ResponseNotifier;
import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
import java.util.List;

import org.eclipse.jetty.client.internal.HttpContentResponse;
import org.eclipse.jetty.client.internal.HttpConversation;
import org.eclipse.jetty.client.internal.HttpExchange;
import org.eclipse.jetty.client.internal.HttpRequest;
import org.eclipse.jetty.client.internal.ResponseNotifier;
import org.eclipse.jetty.client.transport.HttpConversation;
import org.eclipse.jetty.client.transport.HttpExchange;
import org.eclipse.jetty.client.transport.HttpRequest;
import org.eclipse.jetty.client.transport.ResponseNotifier;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpHeaderValue;
import org.eclipse.jetty.http.HttpStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
import java.util.List;

import org.eclipse.jetty.client.internal.HttpContentResponse;
import org.eclipse.jetty.client.internal.HttpConversation;
import org.eclipse.jetty.client.internal.HttpExchange;
import org.eclipse.jetty.client.internal.HttpRequest;
import org.eclipse.jetty.client.internal.ResponseNotifier;
import org.eclipse.jetty.client.transport.HttpConversation;
import org.eclipse.jetty.client.transport.HttpExchange;
import org.eclipse.jetty.client.transport.HttpRequest;
import org.eclipse.jetty.client.transport.ResponseNotifier;
import org.eclipse.jetty.http.HttpFields;
import org.eclipse.jetty.http.HttpStatus;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

package org.eclipse.jetty.client;

import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.RetainableByteBuffer;
import org.eclipse.jetty.io.RetainableByteBufferPool;

/**
* {@link ContentDecoder} for the "gzip" encoding.
Expand All @@ -33,9 +33,9 @@ public GZIPContentDecoder(int bufferSize)
this(null, bufferSize);
}

public GZIPContentDecoder(RetainableByteBufferPool retainableByteBufferPool, int bufferSize)
public GZIPContentDecoder(ByteBufferPool byteBufferPool, int bufferSize)
{
super(retainableByteBufferPool, bufferSize);
super(byteBufferPool, bufferSize);
}

@Override
Expand All @@ -50,7 +50,7 @@ protected boolean decodedChunk(RetainableByteBuffer chunk)
*/
public static class Factory extends ContentDecoder.Factory
{
private final RetainableByteBufferPool retainableByteBufferPool;
private final ByteBufferPool byteBufferPool;
private final int bufferSize;

public Factory()
Expand All @@ -63,22 +63,22 @@ public Factory(int bufferSize)
this(null, bufferSize);
}

public Factory(RetainableByteBufferPool retainableByteBufferPool)
public Factory(ByteBufferPool byteBufferPool)
{
this(retainableByteBufferPool, DEFAULT_BUFFER_SIZE);
this(byteBufferPool, DEFAULT_BUFFER_SIZE);
}

public Factory(RetainableByteBufferPool retainableByteBufferPool, int bufferSize)
public Factory(ByteBufferPool byteBufferPool, int bufferSize)
{
super("gzip");
this.retainableByteBufferPool = retainableByteBufferPool;
this.byteBufferPool = byteBufferPool;
this.bufferSize = bufferSize;
}

@Override
public ContentDecoder newContentDecoder()
{
return new GZIPContentDecoder(retainableByteBufferPool, bufferSize);
return new GZIPContentDecoder(byteBufferPool, bufferSize);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@
import java.util.concurrent.TimeoutException;

import org.eclipse.jetty.client.internal.HttpAuthenticationStore;
import org.eclipse.jetty.client.internal.HttpConversation;
import org.eclipse.jetty.client.internal.HttpDestination;
import org.eclipse.jetty.client.internal.HttpRequest;
import org.eclipse.jetty.client.transport.HttpClientTransportOverHTTP;
import org.eclipse.jetty.client.transport.HttpConversation;
import org.eclipse.jetty.client.transport.HttpDestination;
import org.eclipse.jetty.client.transport.HttpRequest;
import org.eclipse.jetty.http.HttpCompliance;
import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.http.HttpParser;
import org.eclipse.jetty.http.HttpScheme;
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
import org.eclipse.jetty.io.ArrayByteBufferPool;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.ClientConnectionFactory;
import org.eclipse.jetty.io.ClientConnector;
import org.eclipse.jetty.io.RetainableByteBufferPool;
import org.eclipse.jetty.io.ssl.SslClientConnectionFactory;
import org.eclipse.jetty.util.Fields;
import org.eclipse.jetty.util.Jetty;
Expand Down Expand Up @@ -199,9 +199,9 @@ protected void doStart() throws Exception
int maxBucketSize = executor instanceof ThreadPool.SizedThreadPool
? ((ThreadPool.SizedThreadPool)executor).getMaxThreads() / 2
: ProcessorUtils.availableProcessors() * 2;
RetainableByteBufferPool retainableByteBufferPool = getRetainableByteBufferPool();
if (retainableByteBufferPool == null)
setRetainableByteBufferPool(new ArrayRetainableByteBufferPool(0, 2048, 65536, maxBucketSize));
ByteBufferPool byteBufferPool = getByteBufferPool();
if (byteBufferPool == null)
setByteBufferPool(new ArrayByteBufferPool(0, 2048, 65536, maxBucketSize));
Scheduler scheduler = getScheduler();
if (scheduler == null)
{
Expand All @@ -220,7 +220,7 @@ protected void doStart() throws Exception
handlers.put(new ProxyAuthenticationProtocolHandler(this));
handlers.put(new UpgradeProtocolHandler());

decoderFactories.put(new GZIPContentDecoder.Factory(retainableByteBufferPool));
decoderFactories.put(new GZIPContentDecoder.Factory(byteBufferPool));

cookieManager = newCookieManager();
cookieStore = cookieManager.getCookieStore();
Expand Down Expand Up @@ -646,19 +646,19 @@ public ProtocolHandler findProtocolHandler(Request request, Response response)
}

/**
* @return the {@link RetainableByteBufferPool} of this HttpClient
* @return the {@link ByteBufferPool} of this HttpClient
*/
public RetainableByteBufferPool getRetainableByteBufferPool()
public ByteBufferPool getByteBufferPool()
{
return connector.getRetainableByteBufferPool();
return connector.getByteBufferPool();
}

/**
* @param retainableByteBufferPool the {@link RetainableByteBufferPool} of this HttpClient
* @param byteBufferPool the {@link ByteBufferPool} of this HttpClient
*/
public void setRetainableByteBufferPool(RetainableByteBufferPool retainableByteBufferPool)
public void setByteBufferPool(ByteBufferPool byteBufferPool)
{
connector.setRetainableByteBufferPool(retainableByteBufferPool);
connector.setByteBufferPool(byteBufferPool);
}

/**
Expand Down Expand Up @@ -1152,6 +1152,6 @@ public ClientConnectionFactory newSslClientConnectionFactory(SslContextFactory.C
{
if (sslContextFactory == null)
sslContextFactory = getSslContextFactory();
return new SslClientConnectionFactory(sslContextFactory, getRetainableByteBufferPool(), getExecutor(), connectionFactory);
return new SslClientConnectionFactory(sslContextFactory, getByteBufferPool(), getExecutor(), connectionFactory);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.net.SocketAddress;
import java.util.Map;

import org.eclipse.jetty.client.internal.HttpDestination;
import org.eclipse.jetty.client.transport.HttpDestination;
import org.eclipse.jetty.io.ClientConnectionFactory;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import java.util.Objects;
import java.util.concurrent.TimeUnit;

import org.eclipse.jetty.client.internal.HttpConversation;
import org.eclipse.jetty.client.internal.HttpDestination;
import org.eclipse.jetty.client.internal.HttpRequest;
import org.eclipse.jetty.client.internal.TunnelRequest;
import org.eclipse.jetty.client.transport.HttpConversation;
import org.eclipse.jetty.client.transport.HttpDestination;
import org.eclipse.jetty.client.transport.HttpRequest;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.http.HttpScheme;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import java.util.regex.Pattern;

import org.eclipse.jetty.client.internal.HttpContentResponse;
import org.eclipse.jetty.client.internal.HttpConversation;
import org.eclipse.jetty.client.internal.HttpRequest;
import org.eclipse.jetty.client.internal.ResponseNotifier;
import org.eclipse.jetty.client.transport.HttpConversation;
import org.eclipse.jetty.client.transport.HttpRequest;
import org.eclipse.jetty.client.transport.ResponseNotifier;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.http.HttpStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import java.io.InputStream;

import org.eclipse.jetty.io.RetainableByteBufferPool;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.content.InputStreamContentSource;

/**
Expand Down Expand Up @@ -51,7 +51,7 @@ public InputStreamRequestContent(String contentType, InputStream stream)
this(contentType, stream, null);
}

public InputStreamRequestContent(String contentType, InputStream stream, RetainableByteBufferPool bufferPool)
public InputStreamRequestContent(String contentType, InputStream stream, ByteBufferPool bufferPool)
{
super(stream, bufferPool);
this.contentType = contentType;
Expand Down

0 comments on commit 1e808d5

Please sign in to comment.