Top Description Constructors Methods
org.xnio.conduits

public final Class SynchronizedMessageSinkConduit

extends AbstractSynchronizedSinkConduit<MessageSinkConduit>
implements MessageSinkConduit
Class Inheritance
All Implemented Interfaces
org.xnio.conduits.MessageSinkConduit, org.xnio.conduits.SinkConduit, org.xnio.conduits.Conduit
Imports
java.io.IOException, java.nio.ByteBuffer

A synchronized message sink conduit. All conduit operations are wrapped in synchronization blocks for simplified thread safety.
Author
David M. Lloyd

Constructor Summary

AccessConstructor and Description
public
SynchronizedMessageSinkConduit(final MessageSinkConduit
the next conduit in the chain
next
)

Construct a new instance.

public
SynchronizedMessageSinkConduit(final MessageSinkConduit
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 boolean
send(final ByteBuffer
the message to send
src
)

Implements org.xnio.conduits.MessageSinkConduit.send.

Send a complete message.

public boolean
send(final ByteBuffer[]
the buffers holding the message to send
srcs
,
final int
the offset into the buffer array of the first buffer
offs
,
final int
the number of buffers that contain data to send
len
)

Implements org.xnio.conduits.MessageSinkConduit.send.

Send a complete message.

public boolean
sendFinal(final ByteBuffer
the message to send
src
)

Implements org.xnio.conduits.MessageSinkConduit.sendFinal.

Send a complete message.

public boolean
sendFinal(final ByteBuffer[]
the buffers holding the message to send
srcs
,
final int
the offset into the buffer array of the first buffer
offs
,
final int
the number of buffers that contain data to send
len
)

Implements org.xnio.conduits.MessageSinkConduit.sendFinal.

Send a complete message.

Inherited from org.xnio.conduits.AbstractSynchronizedSinkConduit:
awaitWritableawaitWritableflushgetWriteThreadisWriteResumedisWriteShutdownresumeWritessetWriteReadyHandlersuspendWritesterminateWritestruncateWriteswakeupWrites

Constructor Detail

SynchronizedMessageSinkConduitback to summary
public SynchronizedMessageSinkConduit(final MessageSinkConduit next)

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

Parameters
next:MessageSinkConduit

the next conduit in the chain

SynchronizedMessageSinkConduitback to summary
public SynchronizedMessageSinkConduit(final MessageSinkConduit next, final Object lock)

Construct a new instance.

Parameters
next:MessageSinkConduit

the next conduit in the chain

lock:Object

the lock object to use

Method Detail

sendback to summary
public boolean send(final ByteBuffer src) throws IOException

Implements org.xnio.conduits.MessageSinkConduit.send.

Doc from org.xnio.conduits.MessageSinkConduit.send.

Send a complete message.

Parameters
src:ByteBuffer

the message to send

Returns:boolean

the result of the send operation; true if the message was sent, or false if it would block

Exceptions
IOException:
if an I/O error occurs
sendback to summary
public boolean send(final ByteBuffer[] srcs, final int offs, final int len) throws IOException

Implements org.xnio.conduits.MessageSinkConduit.send.

Doc from org.xnio.conduits.MessageSinkConduit.send.

Send a complete message.

Parameters
srcs:ByteBuffer[]

the buffers holding the message to send

offs:int

the offset into the buffer array of the first buffer

len:int

the number of buffers that contain data to send

Returns:boolean

the result of the send operation; true if the message was sent, or false if it would block

Exceptions
IOException:
if an I/O error occurs
sendFinalback to summary
public boolean sendFinal(final ByteBuffer src) throws IOException

Implements org.xnio.conduits.MessageSinkConduit.sendFinal.

Doc from org.xnio.conduits.MessageSinkConduit.sendFinal.

Send a complete message. If the message is successfully sent then the sink will have its writes terminated.

Parameters
src:ByteBuffer

the message to send

Returns:boolean

the result of the send operation; true if the message was sent, or false if it would block

Exceptions
IOException:
if an I/O error occurs
sendFinalback to summary
public boolean sendFinal(final ByteBuffer[] srcs, final int offs, final int len) throws IOException

Implements org.xnio.conduits.MessageSinkConduit.sendFinal.

Doc from org.xnio.conduits.MessageSinkConduit.sendFinal.

Send a complete message. If the message is successfully sent then the sink will have its writes terminated.

Parameters
srcs:ByteBuffer[]

the buffers holding the message to send

offs:int

the offset into the buffer array of the first buffer

len:int

the number of buffers that contain data to send

Returns:boolean

the result of the send operation; true if the message was sent, or false if it would block

Exceptions
IOException:
if an I/O error occurs