XNIO version 1.2.0.GA

org.jboss.xnio.channels
Interface SuspendableWriteChannel

All Superinterfaces:
Channel, Closeable, Configurable
All Known Subinterfaces:
AllocatedMessageChannel, ConnectedStreamChannel<A>, DatagramChannel<A>, MessageChannel, MultipointDatagramChannel<A>, MultipointMessageChannel<A>, MultipointWritableMessageChannel<A>, StreamChannel, StreamSinkChannel, SuspendableChannel, TcpChannel, UdpChannel, WritableMessageChannel

public interface SuspendableWriteChannel
extends Channel, Configurable

A suspendable writable channel. This type of channel is associated with a handler which can suspend and resume writes as needed.


Method Summary
 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 resumeWrites()
          Resume writes on this channel.
 void shutdownWrites()
          Indicate that writing is complete for this channel.
 void suspendWrites()
          Suspend further writes on this channel.
 
Methods inherited from interface java.nio.channels.Channel
close, isOpen
 
Methods inherited from interface org.jboss.xnio.channels.Configurable
getOption, getOptions, setOption
 

Method Detail

suspendWrites

void suspendWrites()
Suspend further writes on this channel. The IoWriteHandler.handleWritable(java.nio.channels.Channel) method will not be called until writes are resumed.


resumeWrites

void resumeWrites()
Resume writes on this channel. The IoWriteHandler.handleWritable(java.nio.channels.Channel) method will be called as soon as there is space in the channel's transmit buffer.


shutdownWrites

void shutdownWrites()
                    throws IOException
Indicate that writing is complete for this channel. Further attempts to write after shutdown will result in an exception.

Throws:
IOException - if an I/O error occurs

awaitWritable

void awaitWritable()
                   throws IOException
Block until this channel becomes writable again. This method may return spuriously before the channel becomes writable.

Throws:
IOException - if an I/O error occurs
Since:
1.2

awaitWritable

void awaitWritable(long time,
                   TimeUnit timeUnit)
                   throws IOException
Block until this channel becomes writable again, or until the timeout expires. This method may return spuriously before the channel becomes writable or the timeout expires.

Parameters:
time - the time to wait
timeUnit - the time unit
Throws:
IOException - if an I/O error occurs
Since:
1.2

XNIO version 1.2.0.GA

Copyright © 2008 JBoss, a division of Red Hat, Inc.