public interface SuspendableWriteChannel extends CloseableChannel
EMPTY
Modifier and Type | Method and Description |
---|---|
void |
awaitWritable()
Block until this channel becomes writable again.
|
void |
awaitWritable(long time,
TimeUnit timeUnit)
Block until this channel becomes writable again, or until the timeout expires.
|
void |
close()
Close this channel.
|
boolean |
flush()
Flush any waiting partial send or write.
|
ChannelListener.Setter<? extends SuspendableWriteChannel> |
getCloseSetter()
Get the setter which can be used to change the close listener for this channel.
|
ChannelListener.Setter<? extends SuspendableWriteChannel> |
getWriteSetter()
Get the setter which can be used to change the write listener for this channel.
|
XnioExecutor |
getWriteThread()
Deprecated.
The
CloseableChannel.getIoThread() method should be used instead. |
boolean |
isOpen()
Determine whether this channel is open.
|
boolean |
isWriteResumed()
Determine whether writes are resumed.
|
void |
resumeWrites()
Resume writes on this channel.
|
void |
shutdownWrites()
Indicate that writing is complete for this channel.
|
void |
suspendWrites()
Suspend further write notifications on this channel.
|
void |
wakeupWrites()
Deprecated.
Users should instead submit
Runnable tasks to the channel thread when this functionality is needed. |
getIoThread, getWorker
getOption, setOption, supportsOption
void suspendWrites()
void resumeWrites()
boolean isWriteResumed()
true
if writes are resumed, false
if writes are suspended@Deprecated void wakeupWrites()
Runnable
tasks to the channel thread when this functionality is needed.Resume writes
on this channel, and force the write listener to be triggered even if the
channel isn't actually writable.void shutdownWrites() throws IOException
flush()
method; once this is done, if the read side of the channel was shut down, the channel will
automatically close.IOException
- if an I/O error occursvoid awaitWritable() throws IOException
InterruptedIOException
- if the operation is interrupted; the thread's interrupt flag will be set as wellIOException
- if an I/O error occursvoid awaitWritable(long time, TimeUnit timeUnit) throws IOException
time
- the time to waittimeUnit
- the time unitInterruptedIOException
- if the operation is interrupted; the thread's interrupt flag will be set as wellIOException
- if an I/O error occurs@Deprecated XnioExecutor getWriteThread()
CloseableChannel.getIoThread()
method should be used instead.null
if none is configured or availableChannelListener.Setter<? extends SuspendableWriteChannel> getWriteSetter()
ChannelListener.Setter<? extends SuspendableWriteChannel> getCloseSetter()
getCloseSetter
in interface CloseableChannel
boolean flush() throws IOException
true
. If there is data to flush which cannot be immediately written, this method
will return false
. If this method returns true
after shutdownWrites()
was called on
this channel, the write listener will no longer be invoked on this channel. If this is case and additionally
this is a write-only channel or the read side was previously shut down, then the channel will
automatically be closed.true
if the message was flushed, or false
if the result would blockIOException
- if an I/O error occursboolean isOpen()
false
if all directions are shut down,
even if there is unflushed write data pending.void close() throws IOException
close
in interface AutoCloseable
close
in interface Channel
close
in interface Closeable
close
in interface CloseableChannel
close
in interface InterruptibleChannel
IOException
- if the close failedCopyright © 2016 JBoss by Red Hat. All rights reserved.