org.glassfish.grizzly
Interface ConnectorHandler<E>

All Known Subinterfaces:
SocketConnectorHandler
All Known Implementing Classes:
AbstractSocketConnectorHandler, TCPNIOConnectorHandler, TCPNIOTransport, UDPNIOConnectorHandler, UDPNIOTransport, UDPNIOTransport.TransportConnectorHandler

public interface ConnectorHandler<E>

Client side connector handler API. ConnectorHandler is responsible for creating and initializing Connection, and optionally connect is to a specific local/remote address.

Author:
Alexey Stashok

Method Summary
 java.util.concurrent.Future<Connection> connect(E remoteAddress)
          Creates, initializes and connects socket to the specific SocketAddress and returns Connection, representing socket.
 void connect(E remoteAddress, CompletionHandler<Connection> completionHandler)
          Creates, initializes and connects socket to the specific SocketAddress and returns Connection, representing socket.
 java.util.concurrent.Future<Connection> connect(E remoteAddress, E localAddress)
          Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket.
 void connect(E remoteAddress, E localAddress, CompletionHandler<Connection> completionHandler)
          Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket.
 

Method Detail

connect

java.util.concurrent.Future<Connection> connect(E remoteAddress)
Creates, initializes and connects socket to the specific SocketAddress and returns Connection, representing socket.

Parameters:
remoteAddress - remote address to connect to.
Returns:
Future of connect operation, which could be used to get resulting Connection.

connect

void connect(E remoteAddress,
             CompletionHandler<Connection> completionHandler)
Creates, initializes and connects socket to the specific SocketAddress and returns Connection, representing socket.

Parameters:
remoteAddress - remote address to connect to.
completionHandler - CompletionHandler.

connect

java.util.concurrent.Future<Connection> connect(E remoteAddress,
                                                E localAddress)
Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket.

Parameters:
remoteAddress - remote address to connect to.
localAddress - local address to bind socket to.
Returns:
Future of connect operation, which could be used to get resulting Connection.

connect

void connect(E remoteAddress,
             E localAddress,
             CompletionHandler<Connection> completionHandler)
Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket.

Parameters:
remoteAddress - remote address to connect to.
localAddress - local address to bind socket to.
completionHandler - CompletionHandler.


Copyright © 2012 Oracle Corporation. All Rights Reserved.