Top Description Methods
org.xnio

public Interface XnioIoFactory

Known Direct Implementers
org.xnio.XnioIoThread, org.xnio.XnioWorker
Imports
java.io.IOException, java.net.SocketAddress, org.xnio.channels.BoundChannel, .StreamChannel, .StreamSinkChannel, .StreamSourceChannel

An XNIO I/O factory which can be used to create channels.
Author
David M. Lloyd

Method Summary

Modifier and TypeMethod and Description
public IoFuture<MessageConnection>

Returns:

the future connection
acceptMessageConnection
(SocketAddress
the destination (bind) address
destination
,
ChannelListener<? super MessageConnection>
the listener which will be notified when the channel is open, or null for none
openListener
,
ChannelListener<? super BoundChannel>
the listener which will be notified when the acceptor is bound, or null for none
bindListener
,
OptionMap
the option map
optionMap
)

Accept a message connection at a destination address.

public IoFuture<StreamConnection>

Returns:

the future connection
acceptStreamConnection
(SocketAddress
the destination (bind) address
destination
,
ChannelListener<? super StreamConnection>
the listener which will be notified when the channel is open, or null for none
openListener
,
ChannelListener<? super BoundChannel>
the listener which will be notified when the acceptor is bound, or null for none
bindListener
,
OptionMap
the option map
optionMap
)

Accept a stream connection at a destination address.

public ChannelPipe<StreamChannel, StreamChannel>

Returns:

the created pipe
createFullDuplexPipe
()

Create a two-way stream pipe.

public ChannelPipe<StreamConnection, StreamConnection>

Returns:

the created pipe
createFullDuplexPipeConnection
()

Create a two-way stream pipe.

public ChannelPipe<StreamConnection, StreamConnection>

Returns:

the created pipe
createFullDuplexPipeConnection
(XnioIoFactory
the peer to use for controlling the remote (right) side
peer
)

Create a two-way stream pipe.

public ChannelPipe<StreamSourceChannel, StreamSinkChannel>

Returns:

the created pipe
createHalfDuplexPipe
()

Create a one-way stream pipe.

public ChannelPipe<StreamSourceChannel, StreamSinkChannel>

Returns:

the created pipe
createHalfDuplexPipe
(XnioIoFactory
the peer to use for the sink (right) side
peer
)

Create a one-way stream pipe.

public IoFuture<MessageConnection>

Returns:

the future result of this operation
openMessageConnection
(SocketAddress
the destination address
destination
,
ChannelListener<? super MessageConnection>
the listener which will be notified when the channel is open, or null for none
openListener
,
OptionMap
the option map
optionMap
)

Connect to a remote message server.

public IoFuture<StreamConnection>

Returns:

the future result of this operation
openStreamConnection
(SocketAddress
the destination address
destination
,
ChannelListener<? super StreamConnection>
the listener which will be notified when the channel is open, or null for none
openListener
,
OptionMap
the option map
optionMap
)

Connect to a remote stream server.

public IoFuture<StreamConnection>

Returns:

the future result of this operation
openStreamConnection
(SocketAddress
the destination address
destination
,
ChannelListener<? super StreamConnection>
the listener which will be notified when the channel is open, or null for none
openListener
,
ChannelListener<? super BoundChannel>
the listener which will be notified when the channel is bound, or null for none
bindListener
,
OptionMap
the option map
optionMap
)

Connect to a remote stream server.

public IoFuture<StreamConnection>

Returns:

the future result of this operation
openStreamConnection
(SocketAddress
the local address to bind to
bindAddress
,
SocketAddress
the destination address
destination
,
ChannelListener<? super StreamConnection>
the listener which will be notified when the channel is open, or null for none
openListener
,
ChannelListener<? super BoundChannel>
the listener which will be notified when the channel is bound, or null for none
bindListener
,
OptionMap
the option map
optionMap
)

Connect to a remote stream server.

Method Detail

acceptMessageConnectionback to summary
public IoFuture<MessageConnection> acceptMessageConnection(SocketAddress destination, ChannelListener<? super MessageConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)

Accept a message connection at a destination address. If a wildcard address is specified, then a destination address is chosen in a manner specific to the OS and/or channel type. If an open listener is used, the channel should not be accessed via the returned IoFuture, and vice-versa.

Parameters
destination:SocketAddress

the destination (bind) address

openListener:ChannelListener<? super MessageConnection>

the listener which will be notified when the channel is open, or null for none

bindListener:ChannelListener<? super BoundChannel>

the listener which will be notified when the acceptor is bound, or null for none

optionMap:OptionMap

the option map

Returns:IoFuture<MessageConnection>

the future connection

acceptStreamConnectionback to summary
public IoFuture<StreamConnection> acceptStreamConnection(SocketAddress destination, ChannelListener<? super StreamConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)

Accept a stream connection at a destination address. If a wildcard address is specified, then a destination address is chosen in a manner specific to the OS and/or channel type.

Parameters
destination:SocketAddress

the destination (bind) address

openListener:ChannelListener<? super StreamConnection>

the listener which will be notified when the channel is open, or null for none

bindListener:ChannelListener<? super BoundChannel>

the listener which will be notified when the acceptor is bound, or null for none

optionMap:OptionMap

the option map

Returns:IoFuture<StreamConnection>

the future connection

createFullDuplexPipeback to summary
public ChannelPipe<StreamChannel, StreamChannel> createFullDuplexPipe() throws IOException

Create a two-way stream pipe.

Returns:ChannelPipe<StreamChannel, StreamChannel>

the created pipe

Exceptions
IOException:
if the pipe could not be created
createFullDuplexPipeConnectionback to summary
public ChannelPipe<StreamConnection, StreamConnection> createFullDuplexPipeConnection() throws IOException

Create a two-way stream pipe.

Returns:ChannelPipe<StreamConnection, StreamConnection>

the created pipe

Exceptions
IOException:
if the pipe could not be created
createFullDuplexPipeConnectionback to summary
public ChannelPipe<StreamConnection, StreamConnection> createFullDuplexPipeConnection(XnioIoFactory peer) throws IOException

Create a two-way stream pipe. The left side will be associated with this factory, and the right side will be associated with the given peer.

Parameters
peer:XnioIoFactory

the peer to use for controlling the remote (right) side

Returns:ChannelPipe<StreamConnection, StreamConnection>

the created pipe

Exceptions
IOException:
if the pipe could not be created
createHalfDuplexPipeback to summary
public ChannelPipe<StreamSourceChannel, StreamSinkChannel> createHalfDuplexPipe() throws IOException

Create a one-way stream pipe.

Returns:ChannelPipe<StreamSourceChannel, StreamSinkChannel>

the created pipe

Exceptions
IOException:
if the pipe could not be created
createHalfDuplexPipeback to summary
public ChannelPipe<StreamSourceChannel, StreamSinkChannel> createHalfDuplexPipe(XnioIoFactory peer) throws IOException

Create a one-way stream pipe. The left (source) side will be associated with this factory, and the right (sink) side will be associated with the given peer.

Parameters
peer:XnioIoFactory

the peer to use for the sink (right) side

Returns:ChannelPipe<StreamSourceChannel, StreamSinkChannel>

the created pipe

Exceptions
IOException:
if the pipe could not be created
openMessageConnectionback to summary
public IoFuture<MessageConnection> openMessageConnection(SocketAddress destination, ChannelListener<? super MessageConnection> openListener, OptionMap optionMap)

Connect to a remote message server. The protocol family is determined by the type of the socket address given. If an open listener is used, the channel should not be accessed via the returned IoFuture, and vice-versa.

Parameters
destination:SocketAddress

the destination address

openListener:ChannelListener<? super MessageConnection>

the listener which will be notified when the channel is open, or null for none

optionMap:OptionMap

the option map

Returns:IoFuture<MessageConnection>

the future result of this operation

openStreamConnectionback to summary
public IoFuture<StreamConnection> openStreamConnection(SocketAddress destination, ChannelListener<? super StreamConnection> openListener, OptionMap optionMap)

Connect to a remote stream server. The protocol family is determined by the type of the socket address given. If an open listener is used, the channel should not be accessed via the returned IoFuture, and vice-versa.

Parameters
destination:SocketAddress

the destination address

openListener:ChannelListener<? super StreamConnection>

the listener which will be notified when the channel is open, or null for none

optionMap:OptionMap

the option map

Returns:IoFuture<StreamConnection>

the future result of this operation

openStreamConnectionback to summary
public IoFuture<StreamConnection> openStreamConnection(SocketAddress destination, ChannelListener<? super StreamConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)

Connect to a remote stream server. The protocol family is determined by the type of the socket address given. If an open listener is used, the channel should not be accessed via the returned IoFuture, and vice-versa.

Parameters
destination:SocketAddress

the destination address

openListener:ChannelListener<? super StreamConnection>

the listener which will be notified when the channel is open, or null for none

bindListener:ChannelListener<? super BoundChannel>

the listener which will be notified when the channel is bound, or null for none

optionMap:OptionMap

the option map

Returns:IoFuture<StreamConnection>

the future result of this operation

openStreamConnectionback to summary
public IoFuture<StreamConnection> openStreamConnection(SocketAddress bindAddress, SocketAddress destination, ChannelListener<? super StreamConnection> openListener, ChannelListener<? super BoundChannel> bindListener, OptionMap optionMap)

Connect to a remote stream server. The protocol family is determined by the type of the socket addresses given (which must match). If an open listener is used, the channel should not be accessed via the returned IoFuture, and vice-versa.

Parameters
bindAddress:SocketAddress

the local address to bind to

destination:SocketAddress

the destination address

openListener:ChannelListener<? super StreamConnection>

the listener which will be notified when the channel is open, or null for none

bindListener:ChannelListener<? super BoundChannel>

the listener which will be notified when the channel is bound, or null for none

optionMap:OptionMap

the option map

Returns:IoFuture<StreamConnection>

the future result of this operation