org.jboss.xnio.nio
Class NioTcpConnector

java.lang.Object
  extended by org.jboss.xnio.nio.NioTcpConnector
All Implemented Interfaces:
java.io.Closeable, CloseableTcpConnector, Connector<java.net.SocketAddress,TcpChannel>, TcpConnector

public final class NioTcpConnector
extends java.lang.Object
implements CloseableTcpConnector


Method Summary
 void close()
           
 FutureConnection<java.net.SocketAddress,TcpChannel> connectTo(java.net.SocketAddress dest, IoHandler<? super TcpChannel> handler)
          Establish a connection to a TCP server.
 FutureConnection<java.net.SocketAddress,TcpChannel> connectTo(java.net.SocketAddress src, java.net.SocketAddress dest, IoHandler<? super TcpChannel> handler)
          Establish a connection to a TCP server.
 TcpChannelSource createChannelSource(java.net.SocketAddress dest)
          Create a client that always connects to the given TCP server.
 TcpChannelSource createChannelSource(java.net.SocketAddress src, java.net.SocketAddress dest)
          Create a client that always connects to the given TCP server from the given source address.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

connectTo

public FutureConnection<java.net.SocketAddress,TcpChannel> connectTo(java.net.SocketAddress dest,
                                                                     IoHandler<? super TcpChannel> handler)
Description copied from interface: TcpConnector
Establish a connection to a TCP server.

Specified by:
connectTo in interface Connector<java.net.SocketAddress,TcpChannel>
Specified by:
connectTo in interface TcpConnector
Parameters:
dest - the destination address
handler - the handler for this connection
Returns:
the future result of this operation

connectTo

public FutureConnection<java.net.SocketAddress,TcpChannel> connectTo(java.net.SocketAddress src,
                                                                     java.net.SocketAddress dest,
                                                                     IoHandler<? super TcpChannel> handler)
Description copied from interface: TcpConnector
Establish a connection to a TCP server.

Specified by:
connectTo in interface Connector<java.net.SocketAddress,TcpChannel>
Specified by:
connectTo in interface TcpConnector
Parameters:
src - the source address
dest - the destination address
handler - the handler for this connection
Returns:
the future result of this operation

createChannelSource

public TcpChannelSource createChannelSource(java.net.SocketAddress dest)
Description copied from interface: TcpConnector
Create a client that always connects to the given TCP server.

Specified by:
createChannelSource in interface Connector<java.net.SocketAddress,TcpChannel>
Specified by:
createChannelSource in interface TcpConnector
Parameters:
dest - the destination to connect to
Returns:
the client

createChannelSource

public TcpChannelSource createChannelSource(java.net.SocketAddress src,
                                            java.net.SocketAddress dest)
Description copied from interface: TcpConnector
Create a client that always connects to the given TCP server from the given source address.

Specified by:
createChannelSource in interface Connector<java.net.SocketAddress,TcpChannel>
Specified by:
createChannelSource in interface TcpConnector
Parameters:
src - the source to connect from
dest - the destination to connect to
Returns:
the client

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object