From 3af9b145a30d5515681a9e01c542af78c12247d3 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 1 Jan 2015 16:18:13 +0100 Subject: [PATCH] Deprecated the AbstractConnection dispatchIO mechanism --- .../org/eclipse/jetty/client/HttpClient.java | 7 ++-- .../org/eclipse/jetty/client/Socks4Proxy.java | 2 +- .../client/http/HttpConnectionOverHTTP.java | 2 +- .../client/HttpClientCustomProxyTest.java | 8 +++-- .../jetty/client/ssl/SslBytesServerTest.java | 2 +- .../client/http/HttpConnectionOverFCGI.java | 2 +- .../fcgi/server/ServerFCGIConnection.java | 2 +- .../client/HTTP2ClientConnectionFactory.java | 6 ++-- .../eclipse/jetty/http2/HTTP2Connection.java | 4 +-- .../AbstractHTTP2ServerConnectionFactory.java | 8 ++--- .../http2/server/HTTP2ServerConnection.java | 4 +-- .../eclipse/jetty/io/AbstractConnection.java | 34 +++++++------------ .../jetty/io/NegotiatingClientConnection.java | 2 +- .../eclipse/jetty/io/ssl/SslConnection.java | 2 +- .../SelectChannelEndPointInterestsTest.java | 2 +- .../jetty/io/SelectChannelEndPointTest.java | 2 +- .../eclipse/jetty/io/SelectorManagerTest.java | 2 +- .../eclipse/jetty/io/SslConnectionTest.java | 2 +- .../eclipse/jetty/proxy/ProxyConnection.java | 2 +- .../eclipse/jetty/server/HttpConnection.java | 4 +-- .../jetty/server/HttpConnectionFactory.java | 2 +- .../server/NegotiatingServerConnection.java | 2 +- .../jetty/server/ProxyConnectionFactory.java | 2 +- .../jetty/server/ExtendedServerTest.java | 2 +- .../SlowClientWithPipelinedRequestTest.java | 2 +- .../client/SPDYClientConnectionFactory.java | 6 ++-- .../jetty/spdy/client/SPDYConnection.java | 8 ++--- .../http/HttpClientCustomProxyTest.java | 8 +++-- .../server/proxy/ProxyHTTPSPDYConnection.java | 2 +- .../server/SPDYServerConnectionFactory.java | 8 ++--- .../client/io/UpgradeConnection.java | 2 +- .../client/io/WebSocketClientConnection.java | 2 +- .../io/AbstractWebSocketConnection.java | 4 +-- .../server/WebSocketServerConnection.java | 4 +-- .../server/WebSocketServerFactory.java | 2 +- 35 files changed, 77 insertions(+), 78 deletions(-) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java index af0e52d07c4..930480c555c 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java @@ -131,7 +131,6 @@ public class HttpClient extends ContainerLifeCycle private volatile long addressResolutionTimeout = 15000; private volatile long idleTimeout; private volatile boolean tcpNoDelay = true; - private volatile boolean dispatchIO = true; private volatile boolean strictEventOrdering = false; private volatile HttpField encodingField; private volatile boolean removeIdleDestinations = false; @@ -836,9 +835,11 @@ public class HttpClient extends ContainerLifeCycle * @return true to dispatch I/O operations in a different thread, false to execute them in the selector thread * @see #setDispatchIO(boolean) */ + @Deprecated public boolean isDispatchIO() { - return dispatchIO; + // TODO this did default to true, so usage needs to be evaluated. + return false; } /** @@ -854,9 +855,9 @@ public class HttpClient extends ContainerLifeCycle * @param dispatchIO true to dispatch I/O operations in a different thread, * false to execute them in the selector thread */ + @Deprecated public void setDispatchIO(boolean dispatchIO) { - this.dispatchIO = dispatchIO; } /** diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/Socks4Proxy.java b/jetty-client/src/main/java/org/eclipse/jetty/client/Socks4Proxy.java index 5078ae40f0b..de40538f7bb 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/Socks4Proxy.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/Socks4Proxy.java @@ -85,7 +85,7 @@ public class Socks4Proxy extends ProxyConfiguration.Proxy public Socks4ProxyConnection(EndPoint endPoint, Executor executor, ClientConnectionFactory connectionFactory, Map context) { - super(endPoint, executor, false); + super(endPoint, executor); this.connectionFactory = connectionFactory; this.context = context; } diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java index d02574417fa..eb65b568c41 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java @@ -44,7 +44,7 @@ public class HttpConnectionOverHTTP extends AbstractConnection implements Connec public HttpConnectionOverHTTP(EndPoint endPoint, HttpDestination destination) { - super(endPoint, destination.getHttpClient().getExecutor(), destination.getHttpClient().isDispatchIO()); + super(endPoint, destination.getHttpClient().getExecutor()); this.delegate = new Delegate(destination); this.channel = new HttpChannelOverHTTP(this); } diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientCustomProxyTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientCustomProxyTest.java index 0b170544099..c85ce40498a 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientCustomProxyTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientCustomProxyTest.java @@ -24,6 +24,7 @@ import java.nio.ByteBuffer; import java.util.Map; import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; + import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -152,9 +153,11 @@ public class HttpClientCustomProxyTest public CAFEBABEConnection(EndPoint endPoint, Executor executor, ClientConnectionFactory connectionFactory, Map context) { - super(endPoint, executor, true); + super(endPoint, executor); this.connectionFactory = connectionFactory; this.context = context; + + throw new IllegalStateException("This was calling super dispatchIO=true. Needs to be reviewed"); } @Override @@ -211,8 +214,9 @@ public class HttpClientCustomProxyTest public CAFEBABEServerConnection(Connector connector, EndPoint endPoint, org.eclipse.jetty.server.ConnectionFactory connectionFactory) { - super(endPoint, connector.getExecutor(), true); + super(endPoint, connector.getExecutor()); this.connectionFactory = connectionFactory; + throw new IllegalStateException("This was calling super dispatchIO=true. Needs to be reviewed"); } @Override diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java index 4d813eff12a..f2f3746b75b 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java @@ -111,7 +111,7 @@ public class SslBytesServerTest extends SslBytesTest @Override public Connection newConnection(Connector connector, EndPoint endPoint) { - return configure(new HttpConnection(getHttpConfiguration(), connector, endPoint, false) + return configure(new HttpConnection(getHttpConfiguration(), connector, endPoint) { @Override protected HttpParser newHttpParser() diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpConnectionOverFCGI.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpConnectionOverFCGI.java index 91f0dee7994..3b90ddc4c10 100644 --- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpConnectionOverFCGI.java +++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpConnectionOverFCGI.java @@ -65,7 +65,7 @@ public class HttpConnectionOverFCGI extends AbstractConnection implements Connec public HttpConnectionOverFCGI(EndPoint endPoint, HttpDestination destination, boolean multiplexed) { - super(endPoint, destination.getHttpClient().getExecutor(), destination.getHttpClient().isDispatchIO()); + super(endPoint, destination.getHttpClient().getExecutor()); this.destination = destination; this.multiplexed = multiplexed; this.flusher = new Flusher(endPoint); diff --git a/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/ServerFCGIConnection.java b/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/ServerFCGIConnection.java index e97c5cb93c3..0c4445eec63 100644 --- a/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/ServerFCGIConnection.java +++ b/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/ServerFCGIConnection.java @@ -48,7 +48,7 @@ public class ServerFCGIConnection extends AbstractConnection public ServerFCGIConnection(Connector connector, EndPoint endPoint, HttpConfiguration configuration, boolean sendStatus200) { - super(endPoint, connector.getExecutor(), false); + super(endPoint, connector.getExecutor()); this.connector = connector; this.flusher = new Flusher(endPoint); this.configuration = configuration; diff --git a/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientConnectionFactory.java b/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientConnectionFactory.java index 36263912503..25a182b4186 100644 --- a/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientConnectionFactory.java +++ b/jetty-http2/http2-client/src/main/java/org/eclipse/jetty/http2/client/HTTP2ClientConnectionFactory.java @@ -66,7 +66,7 @@ public class HTTP2ClientConnectionFactory implements ClientConnectionFactory Generator generator = new Generator(byteBufferPool, 4096); HTTP2ClientSession session = new HTTP2ClientSession(scheduler, endPoint, generator, listener, new HTTP2FlowControl(FlowControl.DEFAULT_WINDOW_SIZE)); Parser parser = new Parser(byteBufferPool, session, 4096, 8192); - return new HTTP2ClientConnection(client, byteBufferPool, executor, endPoint, parser, session, 8192, false, promise, listener); + return new HTTP2ClientConnection(client, byteBufferPool, executor, endPoint, parser, session, 8192, promise, listener); } public int getInitialSessionWindow() @@ -85,9 +85,9 @@ public class HTTP2ClientConnectionFactory implements ClientConnectionFactory private final Promise promise; private final Session.Listener listener; - public HTTP2ClientConnection(HTTP2Client client, ByteBufferPool byteBufferPool, Executor executor, EndPoint endpoint, Parser parser, ISession session, int bufferSize, boolean dispatchIO, Promise promise, Session.Listener listener) + public HTTP2ClientConnection(HTTP2Client client, ByteBufferPool byteBufferPool, Executor executor, EndPoint endpoint, Parser parser, ISession session, int bufferSize, Promise promise, Session.Listener listener) { - super(byteBufferPool, executor, endpoint, parser, session, bufferSize, dispatchIO); + super(byteBufferPool, executor, endpoint, parser, session, bufferSize); this.client = client; this.promise = promise; this.listener = listener; diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Connection.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Connection.java index ed101ed9491..0b97cb53e18 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Connection.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Connection.java @@ -44,9 +44,9 @@ public class HTTP2Connection extends AbstractConnection private final int bufferSize; private final ExecutionStrategy executionStrategy; // TODO: make it pluggable from outside ? - public HTTP2Connection(ByteBufferPool byteBufferPool, Executor executor, EndPoint endPoint, Parser parser, ISession session, int bufferSize, boolean dispatchIO) + public HTTP2Connection(ByteBufferPool byteBufferPool, Executor executor, EndPoint endPoint, Parser parser, ISession session, int bufferSize) { - super(endPoint, executor, dispatchIO); + super(endPoint, executor); this.byteBufferPool = byteBufferPool; this.parser = parser; this.session = session; diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/AbstractHTTP2ServerConnectionFactory.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/AbstractHTTP2ServerConnectionFactory.java index 9c1b1e89d45..50962b67ab8 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/AbstractHTTP2ServerConnectionFactory.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/AbstractHTTP2ServerConnectionFactory.java @@ -35,7 +35,6 @@ import org.eclipse.jetty.util.annotation.Name; public abstract class AbstractHTTP2ServerConnectionFactory extends AbstractConnectionFactory { - private boolean dispatchIO = true; private int maxDynamicTableSize = 4096; private int initialStreamWindow = FlowControl.DEFAULT_WINDOW_SIZE; private int maxConcurrentStreams = -1; @@ -47,14 +46,15 @@ public abstract class AbstractHTTP2ServerConnectionFactory extends AbstractConne this.httpConfiguration = httpConfiguration; } + @Deprecated public boolean isDispatchIO() { - return dispatchIO; + return false; } + @Deprecated public void setDispatchIO(boolean dispatchIO) { - this.dispatchIO = dispatchIO; } public int getMaxDynamicTableSize() @@ -109,7 +109,7 @@ public abstract class AbstractHTTP2ServerConnectionFactory extends AbstractConne Parser parser = newServerParser(connector.getByteBufferPool(), session); HTTP2Connection connection = new HTTP2ServerConnection(connector.getByteBufferPool(), connector.getExecutor(), - endPoint, httpConfiguration, parser, session, getInputBufferSize(), isDispatchIO(), listener); + endPoint, httpConfiguration, parser, session, getInputBufferSize(), listener); return configure(connection, connector, endPoint); } diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerConnection.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerConnection.java index 60a6a2c7306..b9ff8fda6cd 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerConnection.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerConnection.java @@ -40,9 +40,9 @@ public class HTTP2ServerConnection extends HTTP2Connection private final ServerSessionListener listener; private final HttpConfiguration httpConfig; - public HTTP2ServerConnection(ByteBufferPool byteBufferPool, Executor executor, EndPoint endPoint, HttpConfiguration httpConfig, Parser parser, ISession session, int inputBufferSize, boolean dispatchIO, ServerSessionListener listener) + public HTTP2ServerConnection(ByteBufferPool byteBufferPool, Executor executor, EndPoint endPoint, HttpConfiguration httpConfig, Parser parser, ISession session, int inputBufferSize, ServerSessionListener listener) { - super(byteBufferPool, executor, endPoint, parser, session, inputBufferSize, dispatchIO); + super(byteBufferPool, executor, endPoint, parser, session, inputBufferSize); this.listener = listener; this.httpConfig = httpConfig; } diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java index b21bc833b43..3d18de40ba5 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java @@ -45,17 +45,15 @@ public abstract class AbstractConnection implements Connection private final EndPoint _endPoint; private final Executor _executor; private final Callback _readCallback; - private final boolean _dispatchIO; private int _inputBufferSize=2048; - protected AbstractConnection(EndPoint endp, Executor executor, boolean dispatchIO) + protected AbstractConnection(EndPoint endp, Executor executor) { if (executor == null) throw new IllegalArgumentException("Executor must not be null!"); _endPoint = endp; _executor = executor; _readCallback = new ReadCallback(); - _dispatchIO = dispatchIO; } @Override @@ -79,35 +77,29 @@ public abstract class AbstractConnection implements Connection return _executor; } + @Deprecated public boolean isDispatchIO() { - return _dispatchIO; + return false; } protected void failedCallback(final Callback callback, final Throwable x) { - boolean dispatchFailure = isDispatchIO(); - if (dispatchFailure) + // TODO always dispatch failure ? + try { - try + getExecutor().execute(new Runnable() { - getExecutor().execute(new Runnable() + @Override + public void run() { - @Override - public void run() - { - callback.failed(x); - } - }); - } - catch(RejectedExecutionException e) - { - LOG.debug(e); - callback.failed(x); - } + callback.failed(x); + } + }); } - else + catch(RejectedExecutionException e) { + LOG.debug(e); callback.failed(x); } } diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java index 291b799f1d2..cd05630f62f 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/NegotiatingClientConnection.java @@ -38,7 +38,7 @@ public abstract class NegotiatingClientConnection extends AbstractConnection protected NegotiatingClientConnection(EndPoint endp, Executor executor, SSLEngine sslEngine, ClientConnectionFactory connectionFactory, Map context) { - super(endp, executor, false); + super(endp, executor); this.engine = sslEngine; this.connectionFactory = connectionFactory; this.context = context; diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java index f428cb08a05..024977ef776 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java @@ -110,7 +110,7 @@ public class SslConnection extends AbstractConnection { // This connection does not execute calls to onFillable(), so they will be called by the selector thread. // onFillable() does not block and will only wakeup another thread to do the actual reading and handling. - super(endPoint, executor, false); + super(endPoint, executor); this._bufferPool = byteBufferPool; this._sslEngine = sslEngine; this._decryptedEndPoint = newDecryptedEndPoint(); diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointInterestsTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointInterestsTest.java index 339ad9df9ee..f2e7d71bda1 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointInterestsTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointInterestsTest.java @@ -79,7 +79,7 @@ public class SelectChannelEndPointInterestsTest @Override public Connection newConnection(SocketChannel channel, final EndPoint endPoint, Object attachment) { - return new AbstractConnection(endPoint, getExecutor(), false) + return new AbstractConnection(endPoint, getExecutor()) { @Override public void onOpen() diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointTest.java index 02ec0d7465a..c1f45ae2874 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointTest.java @@ -124,7 +124,7 @@ public class SelectChannelEndPointTest public TestConnection(EndPoint endp) { - super(endp, _threadPool, false); + super(endp, _threadPool); } @Override diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/SelectorManagerTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/SelectorManagerTest.java index c499fc77b40..7d63d859381 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/SelectorManagerTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/SelectorManagerTest.java @@ -94,7 +94,7 @@ public class SelectorManagerTest public Connection newConnection(SocketChannel channel, EndPoint endpoint, Object attachment) throws IOException { ((Callback)attachment).succeeded(); - return new AbstractConnection(endpoint, executor, false) + return new AbstractConnection(endpoint, executor) { @Override public void onFillable() diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/SslConnectionTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/SslConnectionTest.java index c740858e39e..466386b2b17 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/SslConnectionTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/SslConnectionTest.java @@ -169,7 +169,7 @@ public class SslConnectionTest public TestConnection(EndPoint endp) { - super(endp, _threadPool,false); + super(endp, _threadPool); } @Override diff --git a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyConnection.java b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyConnection.java index f8e6d44a3d8..3a620f43a17 100644 --- a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyConnection.java +++ b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyConnection.java @@ -41,7 +41,7 @@ public abstract class ProxyConnection extends AbstractConnection protected ProxyConnection(EndPoint endp, Executor executor, ByteBufferPool bufferPool, ConcurrentMap context) { - super(endp, executor, false); + super(endp, executor); this.bufferPool = bufferPool; this.context = context; } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java index 6f76009afb3..b98cbd52c62 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java @@ -88,9 +88,9 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http return last; } - public HttpConnection(HttpConfiguration config, Connector connector, EndPoint endPoint, boolean dispatchIO) + public HttpConnection(HttpConfiguration config, Connector connector, EndPoint endPoint) { - super(endPoint, connector.getExecutor(), dispatchIO); + super(endPoint, connector.getExecutor()); _config = config; _connector = connector; _bufferPool = _connector.getByteBufferPool(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnectionFactory.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnectionFactory.java index 6bf70843fe3..dafda3e6a45 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnectionFactory.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnectionFactory.java @@ -64,6 +64,6 @@ public class HttpConnectionFactory extends AbstractConnectionFactory implements @Override public Connection newConnection(Connector connector, EndPoint endPoint) { - return configure(new HttpConnection(_config, connector, endPoint, false), connector, endPoint); + return configure(new HttpConnection(_config, connector, endPoint), connector, endPoint); } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/NegotiatingServerConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/NegotiatingServerConnection.java index 950fb0d7f2a..eed280956ac 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/NegotiatingServerConnection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/NegotiatingServerConnection.java @@ -47,7 +47,7 @@ public abstract class NegotiatingServerConnection extends AbstractConnection protected NegotiatingServerConnection(Connector connector, EndPoint endPoint, SSLEngine engine, List protocols, String defaultProtocol) { - super(endPoint, connector.getExecutor(), false); + super(endPoint, connector.getExecutor()); this.connector = connector; this.protocols = protocols; this.defaultProtocol = defaultProtocol; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java index 55baa87d1d0..529645903ce 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java @@ -98,7 +98,7 @@ public class ProxyConnectionFactory extends AbstractConnectionFactory protected ProxyConnection(EndPoint endp, Connector connector, String next) { - super(endp,connector.getExecutor(),false); + super(endp,connector.getExecutor()); _connector=connector; _next=next; } diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ExtendedServerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ExtendedServerTest.java index 507f16d4e19..01500ad7045 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ExtendedServerTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ExtendedServerTest.java @@ -94,7 +94,7 @@ public class ExtendedServerTest extends HttpServerTestBase { public ExtendedHttpConnection(HttpConfiguration config, Connector connector, EndPoint endPoint) { - super(config,connector,endPoint,false); + super(config,connector,endPoint); } @Override diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/SlowClientWithPipelinedRequestTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/SlowClientWithPipelinedRequestTest.java index add2e77a230..f77c53f7680 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/SlowClientWithPipelinedRequestTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/SlowClientWithPipelinedRequestTest.java @@ -53,7 +53,7 @@ public class SlowClientWithPipelinedRequestTest @Override public Connection newConnection(Connector connector, EndPoint endPoint) { - return configure(new HttpConnection(new HttpConfiguration(),connector,endPoint,false) + return configure(new HttpConnection(new HttpConfiguration(),connector,endPoint) { @Override public void onFillable() diff --git a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClientConnectionFactory.java b/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClientConnectionFactory.java index 55b3df26422..89456d92555 100644 --- a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClientConnectionFactory.java +++ b/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYClientConnectionFactory.java @@ -52,7 +52,7 @@ public class SPDYClientConnectionFactory implements ClientConnectionFactory Parser parser = new Parser(compressionFactory.newDecompressor()); Generator generator = new Generator(byteBufferPool, compressionFactory.newCompressor()); - SPDYConnection connection = new ClientSPDYConnection(endPoint, byteBufferPool, parser, factory, client.isDispatchIO()); + SPDYConnection connection = new ClientSPDYConnection(endPoint, byteBufferPool, parser, factory); FlowControlStrategy flowControlStrategy = client.newFlowControlStrategy(); @@ -75,9 +75,9 @@ public class SPDYClientConnectionFactory implements ClientConnectionFactory { private final Factory factory; - public ClientSPDYConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, Factory factory, boolean dispatchIO) + public ClientSPDYConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, Factory factory) { - super(endPoint, bufferPool, parser, factory.getExecutor(), dispatchIO); + super(endPoint, bufferPool, parser, factory.getExecutor()); this.factory = factory; } diff --git a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYConnection.java b/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYConnection.java index 52bc964278f..40bd9606b43 100644 --- a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYConnection.java +++ b/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYConnection.java @@ -44,12 +44,12 @@ public class SPDYConnection extends AbstractConnection implements Controller, Id private volatile ISession session; private volatile boolean idle = false; - public SPDYConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, Executor executor, boolean dispatchIO) + public SPDYConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, Executor executor) { - this(endPoint, bufferPool, parser, executor, dispatchIO, 8192); + this(endPoint, bufferPool, parser, executor, 8192); } - public SPDYConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, Executor executor, boolean dispatchIO, int bufferSize) + public SPDYConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, Executor executor, int bufferSize) { // Since SPDY is multiplexed, onFillable() must never block while calling application code. In fact, // the SPDY code always dispatches to a new thread when calling application code, @@ -57,7 +57,7 @@ public class SPDYConnection extends AbstractConnection implements Controller, Id // The IO operation (read, parse, etc.) will not block and will be fast in almost all cases. // Big uploads to a server, however, might occupy the Selector thread for a long time and // therefore starve other connections, so by default dispatchIO is true. - super(endPoint, executor, dispatchIO); + super(endPoint, executor); this.bufferPool = bufferPool; this.parser = parser; onIdle(true); diff --git a/jetty-spdy/spdy-http-client-transport/src/test/java/org/eclipse/jetty/spdy/client/http/HttpClientCustomProxyTest.java b/jetty-spdy/spdy-http-client-transport/src/test/java/org/eclipse/jetty/spdy/client/http/HttpClientCustomProxyTest.java index 05f532aa7ad..5fc1ba81b4f 100644 --- a/jetty-spdy/spdy-http-client-transport/src/test/java/org/eclipse/jetty/spdy/client/http/HttpClientCustomProxyTest.java +++ b/jetty-spdy/spdy-http-client-transport/src/test/java/org/eclipse/jetty/spdy/client/http/HttpClientCustomProxyTest.java @@ -24,6 +24,7 @@ import java.nio.ByteBuffer; import java.util.Map; import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; + import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -168,9 +169,10 @@ public class HttpClientCustomProxyTest public CAFEBABEConnection(EndPoint endPoint, Executor executor, ClientConnectionFactory connectionFactory, Map context) { - super(endPoint, executor, true); + super(endPoint, executor); this.connectionFactory = connectionFactory; this.context = context; + throw new IllegalStateException("This was calling super dispatchIO=true. Needs to be reviewed"); } @Override @@ -227,8 +229,10 @@ public class HttpClientCustomProxyTest public CAFEBABEServerConnection(Connector connector, EndPoint endPoint, org.eclipse.jetty.server.ConnectionFactory connectionFactory) { - super(endPoint, connector.getExecutor(), true); + super(endPoint, connector.getExecutor()); this.connectionFactory = connectionFactory; + + throw new IllegalStateException("This was calling super dispatchIO=true. Needs to be reviewed"); } @Override diff --git a/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPSPDYConnection.java b/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPSPDYConnection.java index 71aec5c13d7..1c7dc666541 100644 --- a/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPSPDYConnection.java +++ b/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/ProxyHTTPSPDYConnection.java @@ -68,7 +68,7 @@ public class ProxyHTTPSPDYConnection extends HttpConnection implements HttpParse public ProxyHTTPSPDYConnection(Connector connector, HttpConfiguration config, EndPoint endPoint, short version, ProxyEngineSelector proxyEngineSelector) { - super(config, connector, endPoint, false); + super(config, connector, endPoint); this.version = version; this.proxyEngineSelector = proxyEngineSelector; this.session = new HTTPSession(version, connector); diff --git a/jetty-spdy/spdy-server/src/main/java/org/eclipse/jetty/spdy/server/SPDYServerConnectionFactory.java b/jetty-spdy/spdy-server/src/main/java/org/eclipse/jetty/spdy/server/SPDYServerConnectionFactory.java index c4ed673308d..aa7e2989325 100644 --- a/jetty-spdy/spdy-server/src/main/java/org/eclipse/jetty/spdy/server/SPDYServerConnectionFactory.java +++ b/jetty-spdy/spdy-server/src/main/java/org/eclipse/jetty/spdy/server/SPDYServerConnectionFactory.java @@ -86,8 +86,7 @@ public class SPDYServerConnectionFactory extends AbstractConnectionFactory Generator generator = new Generator(connector.getByteBufferPool(), compressionFactory.newCompressor()); ServerSessionFrameListener listener = provideServerSessionFrameListener(connector, endPoint); - SPDYConnection connection = new ServerSPDYConnection(connector, endPoint, parser, listener, - isDispatchIO(), getInputBufferSize()); + SPDYConnection connection = new ServerSPDYConnection(connector, endPoint, parser, listener, getInputBufferSize()); FlowControlStrategy flowControlStrategy = newFlowControlStrategy(version); @@ -180,10 +179,9 @@ public class SPDYServerConnectionFactory extends AbstractConnectionFactory private final AtomicBoolean connected = new AtomicBoolean(); private ServerSPDYConnection(Connector connector, EndPoint endPoint, Parser parser, - ServerSessionFrameListener listener, boolean dispatchIO, int bufferSize) + ServerSessionFrameListener listener, int bufferSize) { - super(endPoint, connector.getByteBufferPool(), parser, connector.getExecutor(), - dispatchIO, bufferSize); + super(endPoint, connector.getByteBufferPool(), parser, connector.getExecutor(), bufferSize); this.listener = listener; } diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/UpgradeConnection.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/UpgradeConnection.java index 10e07aec68d..4fa47276ebb 100644 --- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/UpgradeConnection.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/UpgradeConnection.java @@ -103,7 +103,7 @@ public class UpgradeConnection extends AbstractConnection public UpgradeConnection(EndPoint endp, Executor executor, ConnectPromise connectPromise) { - super(endp,executor,connectPromise.getClient().isDispatchIO()); + super(endp,executor); this.connectPromise = connectPromise; this.bufferPool = connectPromise.getClient().getBufferPool(); this.request = connectPromise.getRequest(); diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientConnection.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientConnection.java index b5579aec57d..a362248a7f9 100644 --- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientConnection.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientConnection.java @@ -48,7 +48,7 @@ public class WebSocketClientConnection extends AbstractWebSocketConnection public WebSocketClientConnection(EndPoint endp, Executor executor, ConnectPromise connectPromise, WebSocketPolicy policy) { - super(endp,executor,connectPromise.getClient().getScheduler(),policy,connectPromise.getClient().getBufferPool(),connectPromise.getClient().isDispatchIO()); + super(endp,executor,connectPromise.getClient().getScheduler(),policy,connectPromise.getClient().getBufferPool()); this.connectPromise = connectPromise; this.masker = connectPromise.getMasker(); assert (this.masker != null); diff --git a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/AbstractWebSocketConnection.java b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/AbstractWebSocketConnection.java index 78f6417bd20..31f777e67d1 100644 --- a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/AbstractWebSocketConnection.java +++ b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/AbstractWebSocketConnection.java @@ -219,9 +219,9 @@ public abstract class AbstractWebSocketConnection extends AbstractConnection imp private IOState ioState; private Stats stats = new Stats(); - public AbstractWebSocketConnection(EndPoint endp, Executor executor, Scheduler scheduler, WebSocketPolicy policy, ByteBufferPool bufferPool, boolean dispatchIO) + public AbstractWebSocketConnection(EndPoint endp, Executor executor, Scheduler scheduler, WebSocketPolicy policy, ByteBufferPool bufferPool) { - super(endp,executor,dispatchIO); + super(endp,executor); this.policy = policy; this.bufferPool = bufferPool; this.generator = new Generator(policy,bufferPool); diff --git a/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerConnection.java b/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerConnection.java index b67a1673128..31d011878fc 100644 --- a/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerConnection.java +++ b/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerConnection.java @@ -33,9 +33,9 @@ public class WebSocketServerConnection extends AbstractWebSocketConnection { private final AtomicBoolean opened = new AtomicBoolean(false); - public WebSocketServerConnection(EndPoint endp, Executor executor, Scheduler scheduler, WebSocketPolicy policy, ByteBufferPool bufferPool, boolean dispatchIO) + public WebSocketServerConnection(EndPoint endp, Executor executor, Scheduler scheduler, WebSocketPolicy policy, ByteBufferPool bufferPool) { - super(endp,executor,scheduler,policy,bufferPool,dispatchIO); + super(endp,executor,scheduler,policy,bufferPool); if (policy.getIdleTimeout() > 0) { endp.setIdleTimeout(policy.getIdleTimeout()); diff --git a/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerFactory.java b/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerFactory.java index c8536ecc85d..864ce3c00c4 100644 --- a/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerFactory.java +++ b/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerFactory.java @@ -515,7 +515,7 @@ public class WebSocketServerFactory extends ContainerLifeCycle implements WebSoc ByteBufferPool bufferPool = http.getConnector().getByteBufferPool(); // Setup websocket connection - WebSocketServerConnection wsConnection = new WebSocketServerConnection(endp, executor, scheduler, driver.getPolicy(), bufferPool, http.isDispatchIO()); + WebSocketServerConnection wsConnection = new WebSocketServerConnection(endp, executor, scheduler, driver.getPolicy(), bufferPool); extensionStack.setPolicy(driver.getPolicy()); extensionStack.configure(wsConnection.getParser());