org.glassfish.grizzly
Interface SocketConnectorHandler

All Known Implementing Classes:
AbstractSocketConnectorHandler, TCPNIOConnectorHandler, TCPNIOTransport, UDPNIOConnectorHandler, UDPNIOTransport

public interface SocketConnectorHandler

Socket based client side connector. SocketConnectorHandler is responsible for creating and initializing Connection, and optionally connect is to a specific local/remote address.

Author:
Alexey Stashok

Method Summary
 Future<Connection> connect(SocketAddress remoteAddress)
          Creates, initializes and connects socket to the specific SocketAddress and returns Connection, representing socket.
 Future<Connection> connect(SocketAddress remoteAddress, SocketAddress localAddress)
          Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket.
 Future<Connection> connect(String host, int port)
          Creates, initializes and connects socket to the specific remote host and port and returns Connection, representing socket.
 Processor getProcessor()
          Get the default Processor to process IOEvent, occuring on connection phase.
 ProcessorSelector getProcessorSelector()
          Gets the default ProcessorSelector, which will be used to get Processor to process I/O events, occuring on connection phase.
 void setProcessor(Processor defaultProcessor)
          Set the default Processor to process IOEvent, occuring on connection phase.
 void setProcessorSelector(ProcessorSelector defaultProcessorSelector)
          Sets the default ProcessorSelector, which will be used to get Processor to process I/O events, occuring on connection phase.
 

Method Detail

connect

Future<Connection> connect(String host,
                           int port)
                           throws IOException
Creates, initializes and connects socket to the specific remote host and port and returns Connection, representing socket.

Parameters:
host - remote host to connect to.
port - remote port to connect to.
Returns:
Future of connect operation, which could be used to get resulting Connection.
Throws:
IOException

connect

Future<Connection> connect(SocketAddress remoteAddress)
                           throws IOException
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.
Throws:
IOException

connect

Future<Connection> connect(SocketAddress remoteAddress,
                           SocketAddress localAddress)
                           throws IOException
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.
Throws:
IOException

getProcessor

Processor getProcessor()
Get the default Processor to process IOEvent, occuring on connection phase.

Returns:
the default Processor to process IOEvent, occuring on connection phase.

setProcessor

void setProcessor(Processor defaultProcessor)
Set the default Processor to process IOEvent, occuring on connection phase.

Parameters:
defaultProcessor - the default Processor to process IOEvent, occuring on connection phase.

getProcessorSelector

ProcessorSelector getProcessorSelector()
Gets the default ProcessorSelector, which will be used to get Processor to process I/O events, occuring on connection phase.

Returns:
the default ProcessorSelector, which will be used to get Processor to process I/O events, occuring on connection phase.

setProcessorSelector

void setProcessorSelector(ProcessorSelector defaultProcessorSelector)
Sets the default ProcessorSelector, which will be used to get Processor to process I/O events, occuring on connection phase.

Parameters:
defaultProcessorSelector - the default ProcessorSelector, which will be used to get Processor to process I/O events, occuring on connection phase.


Copyright © 2009 SUN Microsystems. All Rights Reserved.