public interface Channel extends Attachable, HandleableCloseable<Channel>, Configurable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Channel.Receiver
A handler for an incoming message.
|
HandleableCloseable.KeyEMPTY| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this channel.
|
Connection |
getConnection()
Get the connection associated with this channel.
|
<T> T |
getOption(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(Option<T> option,
T value)
Set an option for this channel.
|
boolean |
supportsOption(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, closeAsync, isOpenConnection 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(Option<?> option)
supportsOption in interface Configurableoption - the optiontrue if it is supported<T> T getOption(Option<T> option)
getOption in interface ConfigurableT - the type of the option valueoption - the option to getnull if it is not set<T> T setOption(Option<T> option, T value) throws IllegalArgumentException
setOption in interface 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 © 2018 JBoss by Red Hat. All rights reserved.