Top Inners Fields Constructors Methods
org.xnio.ssl

pack-priv final Class JsseStreamConduit

extends Object
implements StreamSourceConduit, StreamSinkConduit, Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable, org.xnio.conduits.StreamSinkConduit, org.xnio.conduits.SinkConduit, org.xnio.conduits.Conduit, org.xnio.conduits.StreamSourceConduit, org.xnio.conduits.SourceConduit
Static Imports
java.lang.Math.max, .Thread.currentThread, org.xnio.Bits.allAreClear, .Bits.allAreSet, .Bits.anyAreClear, .Bits.anyAreSet, org.xnio._private.Messages.msg

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private final JsseSslConnection
private final SSLEngine
private static final int
FLAG_FLUSH_NEEDED

we need a flush to proceed with handshake

private static final int
FLAG_INLINE_TASKS

Run tasks immediately rather than in the worker

private static final int
FLAG_NEED_ENGINE_TASK

Set when the engine needs the result of a delegated task to continue

private static final int
FLAG_TASK_QUEUED

Set when task is queued; cleared when it runs

private static final int
FLAG_TLS

TLS is enabled

private static final int
private static final int
private static final int
private static final int
private static final ByteBuffer[]
private static final int
READ_FLAG_EOF

-1 was read

private static final int
READ_FLAG_NEEDS_WRITE

read needs wrap to proceed

private static final int
READ_FLAG_READY

user read handler should be called if resumed

private static final int
READ_FLAG_RESUMED

resumeReads() called

private static final int
READ_FLAG_SHUTDOWN

shutdownReads() was called upstream

private static final int
READ_FLAG_UP_RESUMED

upstream resumeReads() called

private static final int
READ_FLAG_WAKEUP

wakeupReads() called

private final Pooled<ByteBuffer>
readBuffer

References Deprecated Pooled is deprecated or references (maybe indirectly) at least one deprecated element.
The buffer into which inbound clear data is written.
private final ByteBuffer[]
private final ReadReadyHandler
private ReadReadyHandler
private final Pooled<ByteBuffer>
receiveBuffer

References Deprecated Pooled is deprecated or references (maybe indirectly) at least one deprecated element.
The buffer into which incoming SSL data is written.
private final Pooled<ByteBuffer>
sendBuffer

References Deprecated Pooled is deprecated or references (maybe indirectly) at least one deprecated element.
The buffer from which outbound SSL data is sent.
private final StreamSinkConduit
private final StreamSourceConduit
private int
private int
private static final boolean
private static final int
WRITE_FLAG_FINISHED

flush() returned true after shutdown

private static final int
WRITE_FLAG_NEEDS_READ

write needs unwrap to proceed

private static final int
WRITE_FLAG_READY

user write handler should be called if resumed

private static final int
WRITE_FLAG_RESUMED

resumeWrites() called

private static final int
WRITE_FLAG_SHUTDOWN

shutdownWrites() was called

private static final int
WRITE_FLAG_SHUTDOWN2

send buffer cleared for final wrap after shutdownWrites()

private static final int
WRITE_FLAG_SHUTDOWN3

wrapping was completed after shutdownWrites() was called

private static final int
WRITE_FLAG_UP_RESUMED

upstream resumeWrites() called

private static final int
WRITE_FLAG_WAKEUP

wakeupWrites() called

private final ByteBuffer[]
private final WriteReadyHandler
private WriteReadyHandler

Constructor Summary

AccessConstructor and Description
pack-priv
JsseStreamConduit(final JsseSslConnection connection, final SSLEngine engine, final StreamSourceConduit sourceConduit, final StreamSinkConduit sinkConduit, final Pool<ByteBuffer> socketBufferPool, final Pool<ByteBuffer> applicationBufferPool)
References Deprecated Pool is deprecated or references (maybe indirectly) at least one deprecated element.

Method Summary

Modifier and TypeMethod and Description
private static long
actualIOResult(final long xfer, final int goal, final boolean flushed, final boolean eof)

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 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.

pack-priv void
private static String
decodeGoal(int goal)

public boolean
flush()

Implements org.xnio.conduits.SinkConduit.flush.

Flush out any unwritten, buffered output.

pack-priv SSLEngine
public XnioIoThread
getReadThread()

Implements org.xnio.conduits.SourceConduit.getReadThread.

Get the XNIO read thread.

pack-priv SSLSession
public String
public XnioWorker
getWorker()

Implements org.xnio.conduits.Conduit.getWorker.

Get the XNIO worker associated with this conduit.

public XnioIoThread
getWriteThread()

Implements org.xnio.conduits.SinkConduit.getWriteThread.

Get the write thread for this conduit.

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.

pack-priv boolean
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.

pack-priv boolean
private long
performIO(final int goal, final ByteBuffer[] srcs, final int srcOff, final int srcLen, final ByteBuffer[] dsts, final int dstOff, final int dstLen)

public int
read(final ByteBuffer
the buffer to fill with data from the conduit
dst
)

Implements org.xnio.conduits.StreamSourceConduit.read.

Read a sequence of bytes from this conduit to the given buffer.

public long
read(final ByteBuffer[]
the buffers to fill with data from the conduit
dsts
,
final int
the offset into the buffer array
offs
,
final int
the number of buffers to fill
len
)

Implements org.xnio.conduits.StreamSourceConduit.read.

Read a sequence of bytes from this conduit to the given buffers.

public void
readReady()

Called by the upstream conduit when reads are ready.

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

Implements java.lang.Runnable.run.

Runs this operation.

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

Implements org.xnio.conduits.SourceConduit.suspendReads.

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

public void
suspendWrites()

Implements org.xnio.conduits.SinkConduit.suspendWrites.

Indicate that calling the conduit's WriteReadyHandler 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
terminateWrites()

Implements org.xnio.conduits.SinkConduit.terminateWrites.

Signal that no more write data is forthcoming.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public long
transferFrom(final FileChannel
the file to read from
src
,
final long
the position within the file from which the transfer is to begin
position
,
final long
the number of bytes to be transferred
count
)

Implements org.xnio.conduits.StreamSinkConduit.transferFrom.

Transfer bytes into this conduit from the given file.

public long
transferFrom(final StreamSourceChannel
the source to read from
source
,
final long
the number of bytes to be transferred
count
,
final ByteBuffer
the buffer to copy through.
throughBuffer
)

Implements org.xnio.conduits.StreamSinkConduit.transferFrom.

Transfers bytes from the given channel source.

public long
transferTo(final long
the position within the file from which the transfer is to begin
position
,
final long
the number of bytes to be transferred
count
,
final FileChannel
the file to write to
target
)

Implements org.xnio.conduits.StreamSourceConduit.transferTo.

Transfers bytes into the given file from this channel.

public long
transferTo(final long
the number of bytes to be transferred
count
,
final ByteBuffer
the buffer to copy through.
throughBuffer
,
final StreamSinkChannel
the destination to write to
target
)

Implements org.xnio.conduits.StreamSourceConduit.transferTo.

Transfers bytes into the given channel target.

public void
truncateWrites()

Implements org.xnio.conduits.SinkConduit.truncateWrites.

Terminate writes and discard any outstanding write data.

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.

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.

public int
write(final ByteBuffer
the buffer containing data to write
src
)

Implements org.xnio.conduits.StreamSinkConduit.write.

Writes a sequence of bytes to this conduit from the given buffer.

public long
write(final ByteBuffer[]
the buffers containing data to write
srcs
,
final int
the offset into the buffer array
offs
,
final int
the number of buffers to write
len
)

Implements org.xnio.conduits.StreamSinkConduit.write.

Writes a sequence of bytes to this conduit from the given buffers.

public int
writeFinal(final ByteBuffer
The data to write
src
)

Implements org.xnio.conduits.StreamSinkConduit.writeFinal.

Writes some data to the conduit, with the same semantics as write(java.nio.ByteBuffer).

public long
writeFinal(final ByteBuffer[]
The buffers from which bytes are to be retrieved
srcs
,
final int
The offset within the buffer array of the first buffer from which bytes are to be retrieved; must be non-negative and no larger than srcs.length
offs
,
final int
The maximum number of buffers to be accessed; must be non-negative and no larger than srcs.length - offset
len
)

Implements org.xnio.conduits.StreamSinkConduit.writeFinal.

Writes some data to the conduit, with the same semantics as write(java.nio.ByteBuffer[], int, int).

public void
writeReady()

Called by the upstream conduit when writes are ready.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

connectionback to summary
private final JsseSslConnection connection
engineback to summary
private final SSLEngine engine
FLAG_FLUSH_NEEDEDback to summary
private static final int FLAG_FLUSH_NEEDED

we need a flush to proceed with handshake

FLAG_INLINE_TASKSback to summary
private static final int FLAG_INLINE_TASKS

Run tasks immediately rather than in the worker

FLAG_NEED_ENGINE_TASKback to summary
private static final int FLAG_NEED_ENGINE_TASK

Set when the engine needs the result of a delegated task to continue

FLAG_TASK_QUEUEDback to summary
private static final int FLAG_TASK_QUEUED

Set when task is queued; cleared when it runs

FLAG_TLSback to summary
private static final int FLAG_TLS

TLS is enabled

IO_GOAL_FLUSHback to summary
private static final int IO_GOAL_FLUSH
IO_GOAL_READback to summary
private static final int IO_GOAL_READ
IO_GOAL_WRITEback to summary
private static final int IO_GOAL_WRITE
IO_GOAL_WRITE_FINALback to summary
private static final int IO_GOAL_WRITE_FINAL
NO_BUFFERSback to summary
private static final ByteBuffer[] NO_BUFFERS
READ_FLAG_EOFback to summary
private static final int READ_FLAG_EOF

-1 was read

READ_FLAG_NEEDS_WRITEback to summary
private static final int READ_FLAG_NEEDS_WRITE

read needs wrap to proceed

READ_FLAG_READYback to summary
private static final int READ_FLAG_READY

user read handler should be called if resumed

READ_FLAG_RESUMEDback to summary
private static final int READ_FLAG_RESUMED

resumeReads() called

READ_FLAG_SHUTDOWNback to summary
private static final int READ_FLAG_SHUTDOWN

shutdownReads() was called upstream

READ_FLAG_UP_RESUMEDback to summary
private static final int READ_FLAG_UP_RESUMED

upstream resumeReads() called

READ_FLAG_WAKEUPback to summary
private static final int READ_FLAG_WAKEUP

wakeupReads() called

readBufferback to summary
private final Pooled<ByteBuffer> readBuffer

References Deprecated

Pooled is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

The buffer into which inbound clear data is written.

readBufferHolderback to summary
private final ByteBuffer[] readBufferHolder
readReadyback to summary
private final ReadReadyHandler readReady
readReadyHandlerback to summary
private ReadReadyHandler readReadyHandler
receiveBufferback to summary
private final Pooled<ByteBuffer> receiveBuffer

References Deprecated

Pooled is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

The buffer into which incoming SSL data is written.

sendBufferback to summary
private final Pooled<ByteBuffer> sendBuffer

References Deprecated

Pooled is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

The buffer from which outbound SSL data is sent.

sinkConduitback to summary
private final StreamSinkConduit sinkConduit
sourceConduitback to summary
private final StreamSourceConduit sourceConduit
stateback to summary
private int state
tasksback to summary
private int tasks
TRACE_SSLback to summary
private static final boolean TRACE_SSL
WRITE_FLAG_FINISHEDback to summary
private static final int WRITE_FLAG_FINISHED

flush() returned true after shutdown

WRITE_FLAG_NEEDS_READback to summary
private static final int WRITE_FLAG_NEEDS_READ

write needs unwrap to proceed

WRITE_FLAG_READYback to summary
private static final int WRITE_FLAG_READY

user write handler should be called if resumed

WRITE_FLAG_RESUMEDback to summary
private static final int WRITE_FLAG_RESUMED

resumeWrites() called

WRITE_FLAG_SHUTDOWNback to summary
private static final int WRITE_FLAG_SHUTDOWN

shutdownWrites() was called

WRITE_FLAG_SHUTDOWN2back to summary
private static final int WRITE_FLAG_SHUTDOWN2

send buffer cleared for final wrap after shutdownWrites()

WRITE_FLAG_SHUTDOWN3back to summary
private static final int WRITE_FLAG_SHUTDOWN3

wrapping was completed after shutdownWrites() was called

WRITE_FLAG_UP_RESUMEDback to summary
private static final int WRITE_FLAG_UP_RESUMED

upstream resumeWrites() called

WRITE_FLAG_WAKEUPback to summary
private static final int WRITE_FLAG_WAKEUP

wakeupWrites() called

writeBufferHolderback to summary
private final ByteBuffer[] writeBufferHolder
writeReadyback to summary
private final WriteReadyHandler writeReady
writeReadyHandlerback to summary
private WriteReadyHandler writeReadyHandler

Constructor Detail

JsseStreamConduitback to summary
pack-priv JsseStreamConduit(final JsseSslConnection connection, final SSLEngine engine, final StreamSourceConduit sourceConduit, final StreamSinkConduit sinkConduit, final Pool<ByteBuffer> socketBufferPool, final Pool<ByteBuffer> applicationBufferPool)

References Deprecated

Pool is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Method Detail

actualIOResultback to summary
private static long actualIOResult(final long xfer, final int goal, final boolean flushed, final boolean eof)
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
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
beginHandshakeback to summary
pack-priv void beginHandshake() throws IOException
decodeGoalback to summary
private static String decodeGoal(int goal)
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
getEngineback to summary
pack-priv SSLEngine getEngine()
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

getSslSessionback to summary
pack-priv SSLSession getSslSession()
getStatusback to summary
public String getStatus()
getWorkerback to summary
public XnioWorker getWorker()

Implements org.xnio.conduits.Conduit.getWorker.

Doc from org.xnio.conduits.Conduit.getWorker.

Get the XNIO worker associated with this conduit.

Returns:XnioWorker

the XNIO worker associated with this conduit

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

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

isTlsback to summary
pack-priv boolean isTls()
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

markTerminatedback to summary
pack-priv boolean markTerminated()
performIOback to summary
private long performIO(final int goal, final ByteBuffer[] srcs, final int srcOff, final int srcLen, final ByteBuffer[] dsts, final int dstOff, final int dstLen) throws IOException
readback to summary
public int read(final ByteBuffer dst) throws IOException

Implements org.xnio.conduits.StreamSourceConduit.read.

Doc from org.xnio.conduits.StreamSourceConduit.read.

Read a sequence of bytes from this conduit to the given buffer.

Parameters
dst:ByteBuffer

the buffer to fill with data from the conduit

Returns:int

the number of bytes (possibly 0) that were actually transferred, or -1 if the end of input was reached or this conduit's terminateReads() method was previously called

Exceptions
IOException:
if an error occurs
readback to summary
public long read(final ByteBuffer[] dsts, final int offs, final int len) throws IOException

Implements org.xnio.conduits.StreamSourceConduit.read.

Doc from org.xnio.conduits.StreamSourceConduit.read.

Read a sequence of bytes from this conduit to the given buffers.

Parameters
dsts:ByteBuffer[]

the buffers to fill with data from the conduit

offs:int

the offset into the buffer array

len:int

the number of buffers to fill

Returns:long

the number of bytes (possibly 0) that were actually transferred, or -1 if the end of input was reached or this conduit's terminateReads() method was previously called

Exceptions
IOException:
if an error occurs
readReadyback to summary
public void readReady()

Called by the upstream conduit when reads are ready.

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.

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.

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

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

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

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.

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.

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
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.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

transferFromback to summary
public long transferFrom(final FileChannel src, final long position, final long count) throws IOException

Implements org.xnio.conduits.StreamSinkConduit.transferFrom.

Doc from org.xnio.conduits.StreamSinkConduit.transferFrom.

Transfer bytes into this conduit from the given file.

Parameters
src:FileChannel

the file to read from

position:long

the position within the file from which the transfer is to begin

count:long

the number of bytes to be transferred

Returns:long

the number of bytes (possibly 0) that were actually transferred

Exceptions
IOException:
if an I/O error occurs
transferFromback to summary
public long transferFrom(final StreamSourceChannel source, final long count, final ByteBuffer throughBuffer) throws IOException

Implements org.xnio.conduits.StreamSinkConduit.transferFrom.

Doc from org.xnio.conduits.StreamSinkConduit.transferFrom.

Transfers bytes from the given channel source. On entry, throughBuffer will be cleared. On exit, the buffer will be flipped for emptying, and may be empty or may contain data. If this method returns a value less than count, then the remaining data in throughBuffer may contain data read from source which must be written to this channel to complete the operation.

Parameters
source:StreamSourceChannel

the source to read from

count:long

the number of bytes to be transferred

throughBuffer:ByteBuffer

the buffer to copy through.

Returns:long

the number of bytes (possibly 0) that were actually transferred, or -1 if the end of input was reached

Exceptions
IOException:
if an I/O error occurs
transferToback to summary
public long transferTo(final long position, final long count, final FileChannel target) throws IOException

Implements org.xnio.conduits.StreamSourceConduit.transferTo.

Doc from org.xnio.conduits.StreamSourceConduit.transferTo.

Transfers bytes into the given file from this channel.

Parameters
position:long

the position within the file from which the transfer is to begin

count:long

the number of bytes to be transferred

target:FileChannel

the file to write to

Returns:long

the number of bytes (possibly 0) that were actually transferred

Exceptions
IOException:
if an I/O error occurs
transferToback to summary
public long transferTo(final long count, final ByteBuffer throughBuffer, final StreamSinkChannel target) throws IOException

Implements org.xnio.conduits.StreamSourceConduit.transferTo.

Doc from org.xnio.conduits.StreamSourceConduit.transferTo.

Transfers bytes into the given channel target. On entry, throughBuffer will be cleared. On exit, the buffer will be flipped for emptying, and may possibly be empty or may contain data. If this method returns a value less than count, then the remaining data in throughBuffer may contain data read from this channel which must be written to target to complete the operation.

Parameters
count:long

the number of bytes to be transferred

throughBuffer:ByteBuffer

the buffer to copy through.

target:StreamSinkChannel

the destination to write to

Returns:long

the number of bytes (possibly 0) that were actually transferred, or -1 if the end of input was reached

Exceptions
IOException:
if an I/O error occurs
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
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.

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.

writeback to summary
public int write(final ByteBuffer src) throws IOException

Implements org.xnio.conduits.StreamSinkConduit.write.

Doc from org.xnio.conduits.StreamSinkConduit.write.

Writes a sequence of bytes to this conduit from the given buffer.

Parameters
src:ByteBuffer

the buffer containing data to write

Returns:int

the number of bytes written, possibly 0

Exceptions
IOException:
if an error occurs
writeback to summary
public long write(final ByteBuffer[] srcs, final int offs, final int len) throws IOException

Implements org.xnio.conduits.StreamSinkConduit.write.

Doc from org.xnio.conduits.StreamSinkConduit.write.

Writes a sequence of bytes to this conduit from the given buffers.

Parameters
srcs:ByteBuffer[]

the buffers containing data to write

offs:int

the offset into the buffer array

len:int

the number of buffers to write

Returns:long

the number of bytes written, possibly 0

Exceptions
IOException:
if an error occurs
writeFinalback to summary
public int writeFinal(final ByteBuffer src) throws IOException

Implements org.xnio.conduits.StreamSinkConduit.writeFinal.

Doc from org.xnio.conduits.StreamSinkConduit.writeFinal.

Writes some data to the conduit, with the same semantics as write(java.nio.ByteBuffer). If all the data is written out then the conduit will have its writes terminated. Semantically this method is equivalent to: int rem = src.remaining(); int written = conduit.write(src); if(written == rem) { conduit.terminateWrites() }

Parameters
src:ByteBuffer

The data to write

Returns:int

The amount of data that was actually written.

writeFinalback to summary
public long writeFinal(final ByteBuffer[] srcs, final int offs, final int len) throws IOException

Implements org.xnio.conduits.StreamSinkConduit.writeFinal.

Doc from org.xnio.conduits.StreamSinkConduit.writeFinal.

Writes some data to the conduit, with the same semantics as write(java.nio.ByteBuffer[], int, int). If all the data is written out then the conduit will have its writes terminated.

Parameters
srcs:ByteBuffer[]

The buffers from which bytes are to be retrieved

offs:int

The offset within the buffer array of the first buffer from which bytes are to be retrieved; must be non-negative and no larger than srcs.length

len:int

The maximum number of buffers to be accessed; must be non-negative and no larger than srcs.length - offset

Returns:long

The amount of data that was actually written

writeReadyback to summary
public void writeReady()

Called by the upstream conduit when writes are ready.

org.xnio.ssl back to summary

pack-priv Class JsseStreamConduit.TaskWrapper

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
private final Runnable

Constructor Summary

AccessConstructor and Description
pack-priv
TaskWrapper(final Runnable task)

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

taskback to summary
private final Runnable task

Constructor Detail

TaskWrapperback to summary
pack-priv TaskWrapper(final Runnable task)

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.