public interface Channel extends Attachable, HandleableCloseable<Channel>, org.xnio.channels.Configurable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Channel.Receiver
A handler for an incoming message.
|
HandleableCloseable.Key| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this channel.
|
Connection |
getConnection()
Get the connection associated with this channel.
|
<T> T |
getOption(org.xnio.Option<T> option)
Get the value of a channel option.
|
void |
receiveMessage(Channel.Receiver handler)
Initiate processing of the next message, when it comes in.
|
<T> T |
setOption(org.xnio.Option<T> option,
T value)
Set an option for this channel.
|
boolean |
supportsOption(org.xnio.Option<?> option)
Determine whether an option is supported on this channel.
|
MessageOutputStream |
writeMessage()
Write a new message on to this channel, blocking if necessary.
|
void |
writeShutdown()
Send an end-of-messages signal to the remote side.
|
getAttachmentsaddCloseHandler, awaitClosed, awaitClosedUninterruptibly, closeAsyncConnection getConnection()
MessageOutputStream writeMessage() throws IOException
IOException - if a new message cannot be writtenvoid writeShutdown()
throws IOException
IOException - if the message could not be writtenvoid receiveMessage(Channel.Receiver handler)
handler - the handler for the next incoming messageboolean supportsOption(org.xnio.Option<?> option)
supportsOption in interface org.xnio.channels.Configurableoption - the optiontrue if it is supported<T> T getOption(org.xnio.Option<T> option)
getOption in interface org.xnio.channels.ConfigurableT - the type of the option valueoption - the option to getnull if it is not set<T> T setOption(org.xnio.Option<T> option,
T value)
throws IllegalArgumentException
setOption in interface org.xnio.channels.ConfigurableT - the type of the option valueoption - the option to setvalue - the value of the option to setIllegalArgumentException - if the value is not acceptable for this optionvoid close()
throws IOException
close in interface AutoCloseableclose in interface Closeableclose in interface HandleableCloseable<Channel>IOException - if a failure occurs during closeCopyright © 2014 JBoss, a division of Red Hat, Inc.. All Rights Reserved.