STATE - State class for connection eventspublic abstract class JnlpProtocolHandler<STATE extends JnlpConnectionState> extends Object
| Modifier and Type | Method and Description |
|---|---|
Future<Channel> |
connect(Socket socket,
Map<String,String> headers,
JnlpConnectionStateListener... listeners)
Handles an outgoing connection to the server on the supplied socket.
|
abstract Future<Channel> |
connect(Socket socket,
Map<String,String> headers,
List<? extends JnlpConnectionStateListener> listeners)
Handles an outgoing connection to the server on the supplied socket.
|
protected abstract STATE |
createConnectionState(Socket socket,
List<? extends JnlpConnectionStateListener> listeners)
Creates the
JnlpConnectionState instance for this JnlpProtocolHandler. |
JnlpClientDatabase |
getClientDatabase()
Gets the
JnlpClientDatabase. |
abstract String |
getName()
Get the name of the protocol.
|
Future<Channel> |
handle(Socket socket,
Map<String,String> headers,
JnlpConnectionStateListener... listeners)
Handles an incoming client connection on the supplied socket.
|
abstract Future<Channel> |
handle(Socket socket,
Map<String,String> headers,
List<? extends JnlpConnectionStateListener> listeners)
Handles an incoming client connection on the supplied socket.
|
boolean |
isEnabled()
Whether this protocol is enabled for connecting.
|
boolean |
isPreferNio()
Gets the preference for Non-Blocking I/O
|
@CheckForNull public JnlpClientDatabase getClientDatabase()
JnlpClientDatabase.JnlpClientDatabase or null.public boolean isPreferNio()
true means that the protocol should attempt to use NIO if possible.public abstract String getName()
public boolean isEnabled()
true if this protocol is enabled.@Nonnull protected abstract STATE createConnectionState(@Nonnull Socket socket, @Nonnull List<? extends JnlpConnectionStateListener> listeners) throws IOException
JnlpConnectionState instance for this JnlpProtocolHandler.socket - the Socketlisteners - the initial JnlpConnectionStateListener instances.JnlpConnectionState for this connection.IOException - if something goes wrong.@Nonnull public final Future<Channel> handle(@Nonnull Socket socket, @Nonnull Map<String,String> headers, @Nonnull JnlpConnectionStateListener... listeners) throws IOException
socket - the socket.headers - the headers to send.listeners - the listeners to approve and receive the connection.Future for the Channel to the server.IOException - if the protocol cannot be initiated.@Nonnull public abstract Future<Channel> handle(@Nonnull Socket socket, @Nonnull Map<String,String> headers, @Nonnull List<? extends JnlpConnectionStateListener> listeners) throws IOException
socket - the socket.headers - the headers to send.listeners - the listeners to approve and receive the connection.Future for the Channel to the server.IOException - if the protocol cannot be initiated.@Nonnull public final Future<Channel> connect(@Nonnull Socket socket, @Nonnull Map<String,String> headers, @Nonnull JnlpConnectionStateListener... listeners) throws IOException
socket - the socket.headers - the headers to send.listeners - the listeners to approve and receive the connection.Future for the Channel to the server.IOException - if the protocol cannot be initiated.@Nonnull public abstract Future<Channel> connect(@Nonnull Socket socket, @Nonnull Map<String,String> headers, @Nonnull List<? extends JnlpConnectionStateListener> listeners) throws IOException
socket - the socket.headers - the headers to send.listeners - the listeners to approve and receive the connection.Future for the Channel to the server.IOException - if the protocol cannot be initiated.Copyright © 2004–2018. All rights reserved.