Top Description Methods
org.xnio.channels

public Interface SuspendableReadChannel

extends CloseableChannel
Known Direct Subinterfaces
org.xnio.channels.ReadableMessageChannel, org.xnio.channels.ReadableMultipointMessageChannel, org.xnio.channels.StreamSourceChannel, org.xnio.channels.SuspendableChannel
Imports
java.io.IOException, .InterruptedIOException, java.util.concurrent.TimeUnit, org.xnio.ChannelListener, .XnioExecutor

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

Method Summary

Modifier and TypeMethod and Description
public void
awaitReadable()

Block until this channel becomes readable again.

public void
awaitReadable(long
the time to wait
time
,
TimeUnit
the time unit
timeUnit
)

Block until this channel becomes readable again, or until the timeout expires.

public ChannelListener.Setter<? extends SuspendableReadChannel>
getCloseSetter()

Redeclares org.xnio.channels.CloseableChannel.getCloseSetter.

Get the setter which can be used to change the close listener for this channel.

public ChannelListener.Setter<? extends SuspendableReadChannel>

Returns:

the setter
getReadSetter
()

Get the setter which can be used to change the read listener for this channel.

public XnioExecutor

Returns:

the thread, or null if none is configured or available
getReadThread
()
Deprecated The getIoThread() method should be used instead.

Get the read thread for this channel.

public boolean

Returns:

true if reads are resumed, false if reads are suspended
isReadResumed
()

Determine whether reads are resumed.

public void
resumeReads()

Resume reads on this channel.

public void
shutdownReads()

Places this readable channel at "end of stream".

public void
suspendReads()

Suspend further read notifications on this channel.

public void
wakeupReads()
Deprecated Users should instead submit Runnable tasks to the channel thread when this functionality is needed.

Resume reads on this channel, and force the read listener to be triggered even if the channel isn't actually readable.

Inherited from org.xnio.channels.CloseableChannel:
closegetIoThreadgetWorker

Method Detail

awaitReadableback to summary
public void awaitReadable() throws IOException

Block until this channel becomes readable again. This method may return spuriously before the channel becomes readable.

Exceptions
IOException:
if an I/O error occurs
InterruptedIOException:
if the operation is interrupted; the thread's interrupt flag will be set as well
Since
1.2
awaitReadableback to summary
public 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:long

the time to wait

timeUnit:TimeUnit

the time unit

Exceptions
IOException:
if an I/O error occurs
InterruptedIOException:
if the operation is interrupted; the thread's interrupt flag will be set as well
Since
1.2
getCloseSetterback to summary
public ChannelListener.Setter<? extends SuspendableReadChannel> getCloseSetter()

Redeclares org.xnio.channels.CloseableChannel.getCloseSetter.

Doc from org.xnio.channels.CloseableChannel.getCloseSetter.

Get the setter which can be used to change the close listener for this channel. If the channel is already closed, then the listener will not be called.

Returns:ChannelListener.Setter<? extends SuspendableReadChannel>

the setter

getReadSetterback to summary
public ChannelListener.Setter<? extends SuspendableReadChannel> getReadSetter()

Get the setter which can be used to change the read listener for this channel.

Returns:ChannelListener.Setter<? extends SuspendableReadChannel>

the setter

Since
2.0
getReadThreadback to summary
public XnioExecutor getReadThread()

Deprecated

The getIoThread() method should be used instead.

Get the read thread for this channel.

Returns:XnioExecutor

the thread, or null if none is configured or available

Annotations
@Deprecated
isReadResumedback to summary
public boolean isReadResumed()

Determine whether reads are resumed.

Returns:boolean

true if reads are resumed, false if reads are suspended

resumeReadsback to summary
public void resumeReads()

Resume reads on this channel. The read listener will be called as soon as there is data available to be read.

shutdownReadsback to summary
public void shutdownReads() throws IOException

Places this readable channel at "end of stream". Further reads will result in EOF. Shutting down all directions of a channel will cause close() to be called automatically.

Exceptions
IOException:
if an I/O error occurs
suspendReadsback to summary
public void suspendReads()

Suspend further read notifications on this channel.

wakeupReadsback to summary
public void wakeupReads()

Deprecated

Users should instead submit Runnable tasks to the channel thread when this functionality is needed.

Resume reads on this channel, and force the read listener to be triggered even if the channel isn't actually readable.

Annotations
@Deprecated