Top Description Methods
org.xnio.conduits

public Interface SinkConduit

extends Conduit
Known Direct Subinterfaces
org.xnio.conduits.StreamSinkConduit, org.xnio.conduits.MessageSinkConduit
Known Direct Implementers
org.xnio.conduits.AbstractSinkConduit, org.xnio.conduits.AbstractSynchronizedSinkConduit
Imports
java.io.IOException, .InterruptedIOException, java.util.concurrent.TimeUnit, org.xnio.XnioIoThread

A conduit which is a target or output for data.
Author
David M. Lloyd

Method Summary

Modifier and TypeMethod and Description
public void
awaitWritable()

Block until this channel becomes writable again.

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

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

public boolean

Returns:

true if everything is flushed, false otherwise
flush
()

Flush out any unwritten, buffered output.

public XnioIoThread

Returns:

the thread, or null if none is configured or available
getWriteThread
()

Get the write thread for this conduit.

public boolean

Returns:

true if write notifications are enabled
isWriteResumed
()

Determine whether write notifications are currently enabled.

public boolean

Returns:

true if writes are fully shut down, false otherwise
isWriteShutdown
()

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

public void
resumeWrites()

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

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

Set the handler which should receive readiness notifications.

public void
suspendWrites()

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

public void
terminateWrites()

Signal that no more write data is forthcoming.

public void
truncateWrites()

Terminate writes and discard any outstanding write data.

public void
wakeupWrites()

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

Inherited from org.xnio.conduits.Conduit:
getWorker

Method Detail

awaitWritableback to summary
public void awaitWritable() throws IOException

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
InterruptedIOException:
if the operation is interrupted; the thread's interrupt flag will be set as well
awaitWritableback to summary
public void awaitWritable(long time, TimeUnit timeUnit) throws IOException

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
InterruptedIOException:
if the operation is interrupted; the thread's interrupt flag will be set as well
flushback to summary
public boolean flush() throws IOException

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()

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()

Determine whether write notifications are currently enabled.

Returns:boolean

true if write notifications are enabled

isWriteShutdownback to summary
public boolean 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()

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

setWriteReadyHandlerback to summary
public void setWriteReadyHandler(WriteReadyHandler 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
handler:WriteReadyHandler

the filter to receive readiness notifications

suspendWritesback to summary
public void suspendWrites()

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

terminateWritesback to summary
public void terminateWrites() throws IOException

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

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()

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