Jetty9 - SPDY cleanups.
This commit is contained in:
parent
103dcd7131
commit
b1bb418fea
|
@ -23,7 +23,7 @@ import org.eclipse.jetty.io.Connection;
|
|||
import org.eclipse.jetty.io.EndPoint;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
|
||||
public class EmptyAsyncEndPoint implements EndPoint
|
||||
public class EmptyEndPoint implements EndPoint
|
||||
{
|
||||
private boolean checkForIdle;
|
||||
private Connection connection;
|
|
@ -26,7 +26,7 @@ import org.eclipse.jetty.util.BufferUtil;
|
|||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
public class NextProtoNegoClientAsyncConnection extends AbstractConnection implements NextProtoNego.ClientProvider
|
||||
public class NextProtoNegoClientConnection extends AbstractConnection implements NextProtoNego.ClientProvider
|
||||
{
|
||||
private final Logger logger = Log.getLogger(getClass());
|
||||
private final SocketChannel channel;
|
||||
|
@ -34,7 +34,7 @@ public class NextProtoNegoClientAsyncConnection extends AbstractConnection imple
|
|||
private final SPDYClient client;
|
||||
private volatile boolean completed;
|
||||
|
||||
public NextProtoNegoClientAsyncConnection(SocketChannel channel, EndPoint endPoint, Object attachment, Executor executor, SPDYClient client)
|
||||
public NextProtoNegoClientConnection(SocketChannel channel, EndPoint endPoint, Object attachment, Executor executor, SPDYClient client)
|
||||
{
|
||||
super(endPoint, executor);
|
||||
this.channel = channel;
|
||||
|
@ -48,7 +48,7 @@ public class NextProtoNegoClientAsyncConnection extends AbstractConnection imple
|
|||
super.onOpen();
|
||||
fillInterested();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onFillable()
|
||||
{
|
|
@ -347,7 +347,7 @@ public class SPDYClient
|
|||
};
|
||||
|
||||
EndPoint sslEndPoint = sslConnection.getDecryptedEndPoint();
|
||||
NextProtoNegoClientAsyncConnection connection = new NextProtoNegoClientAsyncConnection(channel, sslEndPoint, attachment, client.factory.threadPool, client);
|
||||
NextProtoNegoClientConnection connection = new NextProtoNegoClientConnection(channel, sslEndPoint, attachment, client.factory.threadPool, client);
|
||||
sslEndPoint.setConnection(connection);
|
||||
connectionOpened(connection);
|
||||
|
||||
|
@ -414,7 +414,7 @@ public class SPDYClient
|
|||
Parser parser = new Parser(compressionFactory.newDecompressor());
|
||||
Generator generator = new Generator(factory.bufferPool, compressionFactory.newCompressor());
|
||||
|
||||
SPDYAsyncConnection connection = new ClientSPDYAsyncConnection(endPoint, factory.bufferPool, parser, factory);
|
||||
SPDYConnection connection = new ClientSPDYConnection(endPoint, factory.bufferPool, parser, factory);
|
||||
endPoint.setConnection(connection);
|
||||
|
||||
FlowControlStrategy flowControlStrategy = client.newFlowControlStrategy();
|
||||
|
@ -430,11 +430,11 @@ public class SPDYClient
|
|||
return connection;
|
||||
}
|
||||
|
||||
private class ClientSPDYAsyncConnection extends SPDYAsyncConnection
|
||||
private class ClientSPDYConnection extends SPDYConnection
|
||||
{
|
||||
private final Factory factory;
|
||||
|
||||
public ClientSPDYAsyncConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, Factory factory)
|
||||
public ClientSPDYConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, Factory factory)
|
||||
{
|
||||
super(endPoint, bufferPool, parser, factory.threadPool);
|
||||
this.factory = factory;
|
||||
|
|
|
@ -18,23 +18,23 @@ import java.nio.ByteBuffer;
|
|||
import java.util.concurrent.Executor;
|
||||
|
||||
import org.eclipse.jetty.io.AbstractConnection;
|
||||
import org.eclipse.jetty.io.EndPoint;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.EndPoint;
|
||||
import org.eclipse.jetty.io.RuntimeIOException;
|
||||
import org.eclipse.jetty.spdy.parser.Parser;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
public class SPDYAsyncConnection extends AbstractConnection implements Controller<StandardSession.FrameBytes>, IdleListener
|
||||
public class SPDYConnection extends AbstractConnection implements Controller<StandardSession.FrameBytes>, IdleListener
|
||||
{
|
||||
private static final Logger logger = Log.getLogger(SPDYAsyncConnection.class);
|
||||
private static final Logger logger = Log.getLogger(SPDYConnection.class);
|
||||
private final ByteBufferPool bufferPool;
|
||||
private final Parser parser;
|
||||
private volatile ISession session;
|
||||
private volatile boolean idle = false;
|
||||
|
||||
public SPDYAsyncConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, Executor executor)
|
||||
public SPDYConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, Executor executor)
|
||||
{
|
||||
super(endPoint, executor);
|
||||
this.bufferPool = bufferPool;
|
||||
|
@ -48,7 +48,7 @@ public class SPDYAsyncConnection extends AbstractConnection implements Controlle
|
|||
super.onOpen();
|
||||
fillInterested();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onFillable()
|
||||
{
|
|
@ -21,8 +21,6 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
import javax.net.ssl.SSLEngine;
|
||||
|
||||
import org.eclipse.jetty.io.Connection;
|
||||
|
@ -42,7 +40,7 @@ public class SPDYServerConnector extends SelectChannelConnector
|
|||
{
|
||||
private final Queue<Session> sessions = new ConcurrentLinkedQueue<>();
|
||||
private final ServerSessionFrameListener listener;
|
||||
private volatile int initialWindowSize = 65536;
|
||||
private volatile int initialWindowSize;
|
||||
|
||||
public SPDYServerConnector(Server server, ServerSessionFrameListener listener)
|
||||
{
|
||||
|
@ -53,6 +51,7 @@ public class SPDYServerConnector extends SelectChannelConnector
|
|||
{
|
||||
super(server, sslContextFactory);
|
||||
this.listener = listener;
|
||||
setInitialWindowSize(65536);
|
||||
putConnectionFactory("spdy/3", new ServerSPDYAsyncConnectionFactory(SPDY.V3, getByteBufferPool(), getExecutor(), getScheduler(), listener));
|
||||
putConnectionFactory("spdy/2", new ServerSPDYAsyncConnectionFactory(SPDY.V2, getByteBufferPool(), getExecutor(), getScheduler(), listener));
|
||||
setDefaultConnectionFactory(getConnectionFactory("spdy/2"));
|
||||
|
@ -173,25 +172,10 @@ public class SPDYServerConnector extends SelectChannelConnector
|
|||
getSelectorManager().connectionUpgraded(endPoint, oldConnection);
|
||||
}
|
||||
|
||||
private class LazyExecutor implements Executor
|
||||
{
|
||||
@Override
|
||||
public void execute(Runnable command)
|
||||
{
|
||||
Executor threadPool = getExecutor();
|
||||
if (threadPool == null)
|
||||
throw new RejectedExecutionException();
|
||||
threadPool.execute(command);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void dump(Appendable out, String indent) throws IOException
|
||||
{
|
||||
super.dump(out,indent);
|
||||
AggregateLifeCycle.dump(out, indent, new ArrayList<Session>(sessions));
|
||||
super.dump(out, indent);
|
||||
AggregateLifeCycle.dump(out, indent, new ArrayList<>(sessions));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public class ServerSPDYAsyncConnectionFactory implements ConnectionFactory
|
|||
SPDYServerConnector connector = (SPDYServerConnector)attachment;
|
||||
|
||||
ServerSessionFrameListener listener = provideServerSessionFrameListener(endPoint, attachment);
|
||||
SPDYAsyncConnection connection = new ServerSPDYAsyncConnection(endPoint, bufferPool, parser, listener, connector);
|
||||
SPDYConnection connection = new ServerSPDYConnection(endPoint, bufferPool, parser, listener, connector);
|
||||
endPoint.setConnection(connection);
|
||||
|
||||
FlowControlStrategy flowControlStrategy = connector.newFlowControlStrategy(version);
|
||||
|
@ -83,13 +83,13 @@ public class ServerSPDYAsyncConnectionFactory implements ConnectionFactory
|
|||
return listener;
|
||||
}
|
||||
|
||||
private static class ServerSPDYAsyncConnection extends SPDYAsyncConnection
|
||||
private static class ServerSPDYConnection extends SPDYConnection
|
||||
{
|
||||
private final ServerSessionFrameListener listener;
|
||||
private final SPDYServerConnector connector;
|
||||
private volatile boolean connected;
|
||||
|
||||
private ServerSPDYAsyncConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, ServerSessionFrameListener listener, SPDYServerConnector connector)
|
||||
private ServerSPDYConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, ServerSessionFrameListener listener, SPDYServerConnector connector)
|
||||
{
|
||||
super(endPoint, bufferPool, parser, connector.getExecutor());
|
||||
this.listener = listener;
|
||||
|
|
Loading…
Reference in New Issue