Top Description Fields Constructors Methods
org.xnio.conduits

public abstract Class AbstractSynchronizedSourceConduit<D extends SourceConduit>

extends AbstractSynchronizedConduit<D extends SourceConduit>
implements SourceConduit
Class Inheritance
All Implemented Interfaces
org.xnio.conduits.SourceConduit, org.xnio.conduits.Conduit
Known Direct Subclasses
org.xnio.conduits.SynchronizedMessageSourceConduit, org.xnio.conduits.SynchronizedStreamSourceConduit
Imports
java.io.IOException, java.util.concurrent.TimeUnit, org.xnio.XnioIoThread

An abstract synchronized source conduit. All conduit operations are wrapped in synchronization blocks for simplified thread safety.
Author
David M. Lloyd

Field Summary

Inherited from org.xnio.conduits.AbstractSynchronizedConduit:
lock

Constructor Summary

AccessConstructor and Description
protected
AbstractSynchronizedSourceConduit(final D
the next conduit in the chain
next
)

Construct a new instance.

protected
AbstractSynchronizedSourceConduit(final D
the next conduit in the chain
next
,
final Object
the lock object to use
lock
)

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public void
awaitReadable()

Implements org.xnio.conduits.SourceConduit.awaitReadable.

Block until this channel becomes readable again.

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

Implements org.xnio.conduits.SourceConduit.awaitReadable.

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

public XnioIoThread
getReadThread()

Implements org.xnio.conduits.SourceConduit.getReadThread.

Get the XNIO read thread.

public boolean
isReadResumed()

Implements org.xnio.conduits.SourceConduit.isReadResumed.

Determine whether read notifications are currently enabled.

public boolean
isReadShutdown()

Implements org.xnio.conduits.SourceConduit.isReadShutdown.

Determine whether reads have been shut down on this conduit.

public void
resumeReads()

Implements org.xnio.conduits.SourceConduit.resumeReads.

Indicate that the conduit's ReadReadyHandler should be invoked as soon as data can be read without blocking.

public void
setReadReadyHandler(final ReadReadyHandler
the filter to receive readiness notifications
handler
)

Implements org.xnio.conduits.SourceConduit.setReadReadyHandler.

Set the handler which should receive readiness notifications.

public void
suspendReads()

Implements org.xnio.conduits.SourceConduit.suspendReads.

Indicate that calling the conduit's ReadReadyHandler should be suspended.

public void
terminateReads()

Implements org.xnio.conduits.SourceConduit.terminateReads.

Indicate that no more data will be read from this conduit.

public void
wakeupReads()

Implements org.xnio.conduits.SourceConduit.wakeupReads.

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

Constructor Detail

AbstractSynchronizedSourceConduitback to summary
protected AbstractSynchronizedSourceConduit(final D next)

Construct a new instance. A new lock object is created.

Parameters
next:D

the next conduit in the chain

AbstractSynchronizedSourceConduitback to summary
protected AbstractSynchronizedSourceConduit(final D next, final Object lock)

Construct a new instance.

Parameters
next:D

the next conduit in the chain

lock:Object

the lock object to use

Method Detail

awaitReadableback to summary
public void awaitReadable() throws IOException

Implements org.xnio.conduits.SourceConduit.awaitReadable.

Doc from org.xnio.conduits.SourceConduit.awaitReadable.

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
awaitReadableback to summary
public void awaitReadable(final long time, final TimeUnit timeUnit) throws IOException

Implements org.xnio.conduits.SourceConduit.awaitReadable.

Doc from org.xnio.conduits.SourceConduit.awaitReadable.

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:long

the time to wait

timeUnit:TimeUnit

the time unit

Exceptions
IOException:
if an I/O error occurs
getReadThreadback to summary
public XnioIoThread getReadThread()

Implements org.xnio.conduits.SourceConduit.getReadThread.

Doc from org.xnio.conduits.SourceConduit.getReadThread.

Get the XNIO read thread.

Returns:XnioIoThread

the XNIO read thread

isReadResumedback to summary
public boolean isReadResumed()

Implements org.xnio.conduits.SourceConduit.isReadResumed.

Doc from org.xnio.conduits.SourceConduit.isReadResumed.

Determine whether read notifications are currently enabled.

Returns:boolean

true if read notifications are enabled

isReadShutdownback to summary
public boolean isReadShutdown()

Implements org.xnio.conduits.SourceConduit.isReadShutdown.

Doc from org.xnio.conduits.SourceConduit.isReadShutdown.

Determine whether reads have been shut down on this conduit.

Returns:boolean

true if writes are shut down, false otherwise

resumeReadsback to summary
public void resumeReads()

Implements org.xnio.conduits.SourceConduit.resumeReads.

Doc from org.xnio.conduits.SourceConduit.resumeReads.

Indicate that the conduit's ReadReadyHandler should be invoked as soon as data can be read without blocking.

setReadReadyHandlerback to summary
public void setReadReadyHandler(final ReadReadyHandler handler)

Implements org.xnio.conduits.SourceConduit.setReadReadyHandler.

Doc from org.xnio.conduits.SourceConduit.setReadReadyHandler.

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
handler:ReadReadyHandler

the filter to receive readiness notifications

suspendReadsback to summary
public void suspendReads()

Implements org.xnio.conduits.SourceConduit.suspendReads.

Doc from org.xnio.conduits.SourceConduit.suspendReads.

Indicate that calling the conduit's ReadReadyHandler should be suspended.

terminateReadsback to summary
public void terminateReads() throws IOException

Implements org.xnio.conduits.SourceConduit.terminateReads.

Doc from org.xnio.conduits.SourceConduit.terminateReads.

Indicate that no more data will be read from this conduit. If unread data exists, an exception may be thrown.

Exceptions
IOException:
if there was a problem
wakeupReadsback to summary
public void wakeupReads()

Implements org.xnio.conduits.SourceConduit.wakeupReads.

Doc from org.xnio.conduits.SourceConduit.wakeupReads.

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