public class JnlpProtocol4Handler extends JnlpProtocolHandler<Jnlp4ConnectionState>
SSLEngine to perform a TLS upgrade of the plaintext
connection before any connection secrets are exchanged. The subsequent connection is then secured using TLS. The
implementation uses the IOHub for non-blocking I/O wherever possible which removes the bottleneck of
the selector thread being used for linearization and I/O that creates a throughput limit with NioChannelHub.| Constructor and Description |
|---|
JnlpProtocol4Handler(JnlpClientDatabase clientDatabase,
ExecutorService threadPool,
IOHub ioHub,
SSLContext context,
boolean needClientAuth,
boolean preferNio)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Future<Channel> |
connect(Socket socket,
Map<String,String> headers,
List<? extends JnlpConnectionStateListener> listeners)
Handles an outgoing connection to the server on the supplied socket.
|
Jnlp4ConnectionState |
createConnectionState(Socket socket,
List<? extends JnlpConnectionStateListener> listeners)
Creates the
JnlpConnectionState instance for this JnlpProtocolHandler. |
String |
getName()
Get the name of the protocol.
|
Future<Channel> |
handle(Socket socket,
Map<String,String> headers,
List<? extends JnlpConnectionStateListener> listeners)
Handles an incoming client connection on the supplied socket.
|
connect, getClientDatabase, handle, isEnabled, isPreferNiopublic JnlpProtocol4Handler(@Nullable JnlpClientDatabase clientDatabase, @Nonnull ExecutorService threadPool, @Nonnull IOHub ioHub, @Nonnull SSLContext context, boolean needClientAuth, boolean preferNio)
clientDatabase - the client database.threadPool - the thread pool.ioHub - the IOHub.context - the SSLContext.needClientAuth - to force all clients to have a client certificate in order to connect.preferNio - true means that the protocol should attempt to use NIO if possible.public String getName()
getName in class JnlpProtocolHandler<Jnlp4ConnectionState>@Nonnull public Jnlp4ConnectionState createConnectionState(@Nonnull Socket socket, @Nonnull List<? extends JnlpConnectionStateListener> listeners)
JnlpProtocolHandlerJnlpConnectionState instance for this JnlpProtocolHandler.createConnectionState in class JnlpProtocolHandler<Jnlp4ConnectionState>socket - the Socketlisteners - the initial JnlpConnectionStateListener instances.JnlpConnectionState for this connection.@Nonnull public Future<Channel> handle(@Nonnull Socket socket, @Nonnull Map<String,String> headers, @Nonnull List<? extends JnlpConnectionStateListener> listeners) throws IOException
handle in class JnlpProtocolHandler<Jnlp4ConnectionState>socket - the socket.headers - the headers to send to the client.listeners - the listeners to process the connection.Future for the Channel to the server.IOException - if the protocol cannot be initiated.@Nonnull public Future<Channel> connect(@Nonnull Socket socket, @Nonnull Map<String,String> headers, @Nonnull List<? extends JnlpConnectionStateListener> listeners) throws IOException
connect in class JnlpProtocolHandler<Jnlp4ConnectionState>socket - the socket.headers - the headers to send to the server.listeners - the listeners to process the connection.Future for the Channel to the server.IOException - if the protocol cannot be initiated.Copyright © 2004–2020. All rights reserved.