XNIO version 1.2.1.GA

org.jboss.xnio.channels
Interface SuspendableReadChannel

All Superinterfaces:
Channel, Closeable, Configurable
All Known Subinterfaces:
AllocatedMessageChannel, ConnectedStreamChannel<A>, DatagramChannel<A>, MessageChannel, MultipointDatagramChannel<A>, MultipointMessageChannel<A>, MultipointReadableMessageChannel<A>, ReadableAllocatedMessageChannel, ReadableMessageChannel, StreamChannel, StreamSourceChannel, SuspendableChannel, TcpChannel, UdpChannel

public interface SuspendableReadChannel
extends Channel, Configurable

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


Method Summary
 void awaitReadable()
          Block until this channel becomes readable again.
 void awaitReadable(long time, TimeUnit timeUnit)
          Block until this channel becomes readable again, or until the timeout expires.
 void resumeReads()
          Resume reads on this channel.
 void shutdownReads()
          Places this readable channel at "end of stream".
 void suspendReads()
          Suspend further reads 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

suspendReads

void suspendReads()
Suspend further reads on this channel. The IoReadHandler.handleReadable(java.nio.channels.Channel) method will not be called until reads are resumed.


resumeReads

void resumeReads()
Resume reads on this channel. The IoReadHandler.handleReadable(java.nio.channels.Channel) method will be called as soon as there is data available to be read.


shutdownReads

void shutdownReads()
                   throws IOException
Places this readable channel at "end of stream". Further reads will result in EOF.

Throws:
IOException - if an I/O error occurs

awaitReadable

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

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

awaitReadable

void awaitReadable(long time,
                   TimeUnit timeUnit)
                   throws IOException
Block until this channel becomes readable again, or until the timeout expires. This method may return spuriously before the channel becomes readable 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.1.GA

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