Package org.xnio.conduits

# Interface SourceConduit

All Superinterfaces:
  `Conduit`

All Known Subinterfaces:
  `MessageSourceConduit`, `StreamSourceConduit`

All Known Implementing Classes:
  `AbstractMessageSourceConduit`, `AbstractSourceConduit`, `AbstractStreamSourceConduit`, `AbstractSynchronizedSourceConduit`, `BlockingStreamSourceConduit`, `BufferedStreamSourceConduit`, `EmptyStreamSourceConduit`, `FixedLengthStreamSourceConduit`, `FramingMessageSourceConduit`, `InflatingStreamSourceConduit`, `MessageStreamSourceConduit`, `PushBackStreamSourceConduit`, `StreamSourceChannelWrappingConduit`, `SynchronizedMessageSourceConduit`, `SynchronizedStreamSourceConduit`

public interface SourceConduit extends Conduit

Author:
  David M. Lloyd

## Method Summary

Modifier and Type
Method
Description
`void`
`awaitReadable()`
Block until this channel becomes readable again.
`void`
`awaitReadable(long time, TimeUnit timeUnit)`
Block until this conduit becomes readable again, or until the timeout expires.
`XnioIoThread`
`getReadThread()`
Get the XNIO read thread.
`boolean`
`isReadResumed()`
Determine whether read notifications are currently enabled.
`boolean`
`isReadShutdown()`
Determine whether reads have been shut down on this conduit.
`void`
`resumeReads()`
Indicate that the conduit's `ReadReadyHandler` should be invoked as soon as data can be read without blocking.
`void`
`setReadReadyHandler(ReadReadyHandler handler)`
Set the handler which should receive readiness notifications.
`void`
`suspendReads()`
Indicate that calling the conduit's `ReadReadyHandler` should be suspended.
`void`
`terminateReads()`
Indicate that no more data will be read from this conduit.
`void`
`wakeupReads()`
Indicate that the conduit's `ReadReadyHandler` should be invoked immediately, and then again as soon as data can be read without blocking.

### Methods inherited from interface org.xnio.conduits.Conduit

`getWorker`

## Method Details

### terminateReads

void terminateReads() throws IOException
Indicate that no more data will be read from this conduit. If unread data exists, an exception may be thrown.

Throws:
  `IOException` - if there was a problem

### isReadShutdown

boolean isReadShutdown()
Determine whether reads have been shut down on this conduit.

Returns:
  `true` if writes are shut down, `false` otherwise

### resumeReads

void resumeReads()
Indicate that the conduit's `ReadReadyHandler` should be invoked as soon as data can be read without blocking.

### suspendReads

void suspendReads()
Indicate that calling the conduit's `ReadReadyHandler` should be suspended.

### wakeupReads

void wakeupReads()
Indicate that the conduit's `ReadReadyHandler` should be invoked immediately, and then again as soon as data can be read without blocking.

### isReadResumed

boolean isReadResumed()
Determine whether read notifications are currently enabled.

Returns:
  `true` if read notifications are enabled

### awaitReadable

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

Throws:
  `InterruptedIOException` - if the operation is interrupted; the thread's interrupt flag will be set as well
  `IOException` - if an I/O error occurs

### awaitReadable

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

Parameters:
  `time` - the time to wait
  `timeUnit` - the time unit
Throws:
  `InterruptedIOException` - if the operation is interrupted; the thread's interrupt flag will be set as well
  `IOException` - if an I/O error occurs

### getReadThread

XnioIoThread getReadThread()
Get the XNIO read thread.

Returns:
  the XNIO read thread

### setReadReadyHandler

void setReadReadyHandler(ReadReadyHandler handler)
Set the handler which should receive readiness notifications. A filter may pass this invocation on to the filter it wraps, or it may substitute itself.

Parameters:
  `next` - the filter to receive readiness notifications