Top Fields Constructors Methods
org.xnio.conduits

public abstract Class AbstractSynchronizedSinkConduit<D extends SinkConduit>

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

Author
David M. Lloyd

Field Summary

Inherited from org.xnio.conduits.AbstractSynchronizedConduit:
lock

Constructor Summary

AccessConstructor and Description
protected
protected
AbstractSynchronizedSinkConduit(final D next, final Object lock)

Method Summary

Modifier and TypeMethod and Description
public void
awaitWritable()

Implements org.xnio.conduits.SinkConduit.awaitWritable.

Block until this channel becomes writable again.

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

Implements org.xnio.conduits.SinkConduit.awaitWritable.

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

public boolean
flush()

Implements org.xnio.conduits.SinkConduit.flush.

Flush out any unwritten, buffered output.

public XnioIoThread
getWriteThread()

Implements org.xnio.conduits.SinkConduit.getWriteThread.

Get the write thread for this conduit.

public boolean
isWriteResumed()

Implements org.xnio.conduits.SinkConduit.isWriteResumed.

Determine whether write notifications are currently enabled.

public boolean
isWriteShutdown()

Implements org.xnio.conduits.SinkConduit.isWriteShutdown.

Determine whether writes have been fully shut down on this conduit.

public void
resumeWrites()

Implements org.xnio.conduits.SinkConduit.resumeWrites.

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

public void
setWriteReadyHandler(final WriteReadyHandler
the filter to receive readiness notifications
handler
)

Implements org.xnio.conduits.SinkConduit.setWriteReadyHandler.

Set the handler which should receive readiness notifications.

public void
suspendWrites()

Implements org.xnio.conduits.SinkConduit.suspendWrites.

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

public void
terminateWrites()

Implements org.xnio.conduits.SinkConduit.terminateWrites.

Signal that no more write data is forthcoming.

public void
truncateWrites()

Implements org.xnio.conduits.SinkConduit.truncateWrites.

Terminate writes and discard any outstanding write data.

public void
wakeupWrites()

Implements org.xnio.conduits.SinkConduit.wakeupWrites.

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

Constructor Detail

AbstractSynchronizedSinkConduitback to summary
protected AbstractSynchronizedSinkConduit(final D next)
AbstractSynchronizedSinkConduitback to summary
protected AbstractSynchronizedSinkConduit(final D next, final Object lock)

Method Detail

awaitWritableback to summary
public void awaitWritable() throws IOException

Implements org.xnio.conduits.SinkConduit.awaitWritable.

Doc from org.xnio.conduits.SinkConduit.awaitWritable.

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

Exceptions
IOException:
if an I/O error occurs
awaitWritableback to summary
public void awaitWritable(final long time, final TimeUnit timeUnit) throws IOException

Implements org.xnio.conduits.SinkConduit.awaitWritable.

Doc from org.xnio.conduits.SinkConduit.awaitWritable.

Block until this conduit becomes writable again, or until the timeout expires. This method may return spuriously before the conduit becomes writable or the timeout expires.

Parameters
time:long

the time to wait

timeUnit:TimeUnit

the time unit

Exceptions
IOException:
if an I/O error occurs
flushback to summary
public boolean flush() throws IOException

Implements org.xnio.conduits.SinkConduit.flush.

Doc from org.xnio.conduits.SinkConduit.flush.

Flush out any unwritten, buffered output.

Returns:boolean

true if everything is flushed, false otherwise

Exceptions
IOException:
if flush fails
getWriteThreadback to summary
public XnioIoThread getWriteThread()

Implements org.xnio.conduits.SinkConduit.getWriteThread.

Doc from org.xnio.conduits.SinkConduit.getWriteThread.

Get the write thread for this conduit.

Returns:XnioIoThread

the thread, or null if none is configured or available

isWriteResumedback to summary
public boolean isWriteResumed()

Implements org.xnio.conduits.SinkConduit.isWriteResumed.

Doc from org.xnio.conduits.SinkConduit.isWriteResumed.

Determine whether write notifications are currently enabled.

Returns:boolean

true if write notifications are enabled

isWriteShutdownback to summary
public boolean isWriteShutdown()

Implements org.xnio.conduits.SinkConduit.isWriteShutdown.

Doc from org.xnio.conduits.SinkConduit.isWriteShutdown.

Determine whether writes have been fully shut down on this conduit.

Returns:boolean

true if writes are fully shut down, false otherwise

resumeWritesback to summary
public void resumeWrites()

Implements org.xnio.conduits.SinkConduit.resumeWrites.

Doc from org.xnio.conduits.SinkConduit.resumeWrites.

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

setWriteReadyHandlerback to summary
public void setWriteReadyHandler(final WriteReadyHandler handler)

Implements org.xnio.conduits.SinkConduit.setWriteReadyHandler.

Doc from org.xnio.conduits.SinkConduit.setWriteReadyHandler.

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

the filter to receive readiness notifications

suspendWritesback to summary
public void suspendWrites()

Implements org.xnio.conduits.SinkConduit.suspendWrites.

Doc from org.xnio.conduits.SinkConduit.suspendWrites.

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

terminateWritesback to summary
public void terminateWrites() throws IOException

Implements org.xnio.conduits.SinkConduit.terminateWrites.

Doc from org.xnio.conduits.SinkConduit.terminateWrites.

Signal that no more write data is forthcoming. The conduit must be flush()ed before it is considered to be shut down.

truncateWritesback to summary
public void truncateWrites() throws IOException

Implements org.xnio.conduits.SinkConduit.truncateWrites.

Doc from org.xnio.conduits.SinkConduit.truncateWrites.

Terminate writes and discard any outstanding write data. The conduit is terminated and flushed regardless of the outcome of this method.

Exceptions
IOException:
if channel termination failed for some reason
wakeupWritesback to summary
public void wakeupWrites()

Implements org.xnio.conduits.SinkConduit.wakeupWrites.

Doc from org.xnio.conduits.SinkConduit.wakeupWrites.

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