Package org.xnio.conduits

# Class AbstractSourceConduit<D extends SourceConduit>

java.lang.Object
org.xnio.conduits.AbstractConduit<D>
org.xnio.conduits.AbstractSourceConduit<D>

All Implemented Interfaces:
  `Conduit`, `SourceConduit`

Direct Known Subclasses:
  `AbstractMessageSourceConduit`, `AbstractStreamSourceConduit`, `FramingMessageSourceConduit`, `MessageStreamSourceConduit`

public abstract class AbstractSourceConduit<D extends SourceConduit> extends AbstractConduit<D> implements SourceConduit
An abstract base class for filtering source conduits.

Author:
  David M. Lloyd

## Field Summary

### Fields inherited from class org.xnio.conduits.AbstractConduit

`next`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`AbstractSourceConduit(D next)`
Construct a new instance.

## 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 class org.xnio.conduits.AbstractConduit

`getWorker`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

`getWorker`

## Constructor Details

### AbstractSourceConduit

protected AbstractSourceConduit(D next)
Construct a new instance.

Parameters:
  `next` - the delegate conduit to set

## Method Details

### terminateReads

public void terminateReads() throws IOException
Description copied from interface: `SourceConduit`
Indicate that no more data will be read from this conduit. If unread data exists, an exception may be thrown.

Specified by:
  `terminateReads` in interface `SourceConduit`
Throws:
  `IOException` - if there was a problem

### isReadShutdown

public boolean isReadShutdown()
Description copied from interface: `SourceConduit`
Determine whether reads have been shut down on this conduit.

Specified by:
  `isReadShutdown` in interface `SourceConduit`
Returns:
  `true` if writes are shut down, `false` otherwise

### resumeReads

public void resumeReads()
Description copied from interface: `SourceConduit`
Indicate that the conduit's `ReadReadyHandler` should be invoked as soon as data can be read without blocking.

Specified by:
  `resumeReads` in interface `SourceConduit`

### suspendReads

public void suspendReads()
Description copied from interface: `SourceConduit`
Indicate that calling the conduit's `ReadReadyHandler` should be suspended.

Specified by:
  `suspendReads` in interface `SourceConduit`

### wakeupReads

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

Specified by:
  `wakeupReads` in interface `SourceConduit`

### isReadResumed

public boolean isReadResumed()
Description copied from interface: `SourceConduit`
Determine whether read notifications are currently enabled.

Specified by:
  `isReadResumed` in interface `SourceConduit`
Returns:
  `true` if read notifications are enabled

### awaitReadable

public void awaitReadable() throws IOException
Description copied from interface: `SourceConduit`
Block until this channel becomes readable again. This method may return spuriously before the channel becomes readable.

Specified by:
  `awaitReadable` in interface `SourceConduit`
Throws:
  `IOException` - if an I/O error occurs

### awaitReadable

public void awaitReadable(long time, TimeUnit timeUnit) throws IOException
Description copied from interface: `SourceConduit`
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.

Specified by:
  `awaitReadable` in interface `SourceConduit`
Parameters:
  `time` - the time to wait
  `timeUnit` - the time unit
Throws:
  `IOException` - if an I/O error occurs

### getReadThread

public XnioIoThread getReadThread()
Description copied from interface: `SourceConduit`
Get the XNIO read thread.

Specified by:
  `getReadThread` in interface `SourceConduit`
Returns:
  the XNIO read thread

### setReadReadyHandler

public void setReadReadyHandler(ReadReadyHandler handler)
Description copied from interface: `SourceConduit`
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.

Specified by:
  `setReadReadyHandler` in interface `SourceConduit`