XNIO version 1.0.0.GA

org.jboss.xnio
Interface Connector<A,T extends ConnectedChannel<A>>

Type Parameters:
A - the address type
T - the type of channel
All Known Subinterfaces:
CloseableConnector<A,T>, CloseableTcpConnector, TcpConnector

public interface Connector<A,T extends ConnectedChannel<A>>

A connector. Instances of this interface are used to connect to arbitrary peers.


Method Summary
 IoFuture<T> connectTo(A src, A dest, IoHandler<? super T> handler)
          Establish a connection to a destination using an explicit source.
 IoFuture<T> connectTo(A dest, IoHandler<? super T> handler)
          Establish a connection to a destination.
 ChannelSource<T> createChannelSource(A dest)
          Create a client that always connects to the given destination.
 ChannelSource<T> createChannelSource(A src, A dest)
          Create a client that always connects to the given destination using an explicit source.
 

Method Detail

connectTo

IoFuture<T> connectTo(A dest,
                      IoHandler<? super T> handler)
Establish a connection to a destination.

Parameters:
dest - the destination address
handler - the handler for this connection
Returns:
the future result of this operation

connectTo

IoFuture<T> connectTo(A src,
                      A dest,
                      IoHandler<? super T> handler)
Establish a connection to a destination using an explicit source.

Parameters:
src - the source address
dest - the destination address
handler - the handler for this connection
Returns:
the future result of this operation

createChannelSource

ChannelSource<T> createChannelSource(A dest)
Create a client that always connects to the given destination.

Parameters:
dest - the destination to connect to
Returns:
the client

createChannelSource

ChannelSource<T> createChannelSource(A src,
                                     A dest)
Create a client that always connects to the given destination using an explicit source.

Parameters:
src - the source to connect from
dest - the destination to connect to
Returns:
the client

XNIO version 1.0.0.GA

Copyright © 2008 JBoss, a division of Red Hat, Inc.