XNIO API 2.0.0.GA

org.jboss.xnio
Interface Connector<A,T extends java.nio.channels.Channel>

Type Parameters:
A - the address type
T - the type of channel
All Known Subinterfaces:
LocalDatagramConnector, LocalStreamConnector, TcpConnector

public interface Connector<A,T extends java.nio.channels.Channel>

A connector. Instances of this interface are used to connect to arbitrary peers from arbitrary bound source addresses.


Method Summary
 IoFuture<T> connectTo(A dest, ChannelListener<? super T> openListener, ChannelListener<? super BoundChannel<A>> bindListener)
          Establish a connection to a destination.
 ChannelSource<T> createChannelSource(A dest)
          Create a client that always connects to the given destination.
 

Method Detail

connectTo

IoFuture<T> connectTo(A dest,
                      ChannelListener<? super T> openListener,
                      ChannelListener<? super BoundChannel<A>> bindListener)
Establish a connection to a destination.

Parameters:
dest - the destination address
openListener - the handler which will be notified when the channel is open, or null for none
bindListener - the handler which will be notified when the channel is bound, or null for none
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

XNIO API 2.0.0.GA

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