public interface SuspendableWriteChannel extends CloseableChannel
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.
|
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()
Get the write thread for this channel.
|
boolean |
isWriteResumed()
Determine whether writes are resumed.
|
void |
resumeWrites()
Resume writes on this channel.
|
boolean |
shutdownWrites()
Indicate that writing is complete for this channel.
|
void |
suspendWrites()
Suspend further write notifications on this channel.
|
void |
wakeupWrites()
Resume writes on this channel, and force the write listener to be triggered even if the
channel isn't actually writable. |
getWorker
close
getOption, setOption, supportsOption
void suspendWrites()
void resumeWrites()
boolean isWriteResumed()
true
if writes are resumed, false
if writes are suspendedvoid wakeupWrites()
Resume writes
on this channel, and force the write listener to be triggered even if the
channel isn't actually writable.boolean shutdownWrites() throws IOException
InterruptibleChannel.close()
to be called automatically.true
if the write channel was closed, or false
if the operation would have blockedIOException
- 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 occursXnioExecutor getWriteThread()
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
in this case, since there is no outstanding data to flush.true
if the message was flushed, or false
if the result would blockIOException
- if an I/O error occursCopyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.