public class WritableSslChannel extends WritableBufferedChannel implements TasksListener
SelectionChannel
as some framework
classes rely on this down the processing chain.Constructor and Description |
---|
WritableSslChannel(WritableSelectionChannel target,
SslConnection<?> connection,
WakeupListener wakeupListener)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canLoop(Buffer buffer,
Object... args)
Indicates if the processing loop can continue.
|
boolean |
couldFill(Buffer buffer,
Object... args)
Indicates if the buffer could be filled again.
|
protected SslConnection<?> |
getConnection()
Returns the parent SSL connection.
|
void |
onCompleted()
Callback method invoked upon delegated tasks completion.
|
int |
onFill(Buffer buffer,
Object... args)
Fills the byte buffer by writing the current message.
|
void |
postProcess(int drained)
Does nothing by default.
|
int |
write(ByteBuffer sourceBuffer)
Reads some bytes and put them into the destination buffer.
|
couldDrain, onDrain
close, getBuffer, onFillEof, preProcess
getRegistration, isBlocking, setRegistration, toString
getWrappedChannel, isOpen
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getRegistration
isBlocking
public WritableSslChannel(WritableSelectionChannel target, SslConnection<?> connection, WakeupListener wakeupListener)
target
- The wrapped channel.connection
- The parent SSL connection.wakeupListener
- The wakeup listener that will be notified.public boolean canLoop(Buffer buffer, Object... args)
BufferedSelectionChannel
canLoop
in interface BufferProcessor
canLoop
in class BufferedSelectionChannel<WritableSelectionChannel>
buffer
- The IO buffer to drain.args
- The optional arguments to pass back to the callbacks.public boolean couldFill(Buffer buffer, Object... args)
WritableBufferedChannel
couldFill
in interface BufferProcessor
couldFill
in class WritableBufferedChannel
buffer
- The IO buffer to fill.args
- The optional arguments to pass back to the callbacks.protected SslConnection<?> getConnection()
public void onCompleted()
onCompleted
in interface TasksListener
public int onFill(Buffer buffer, Object... args) throws IOException
WritableBufferedChannel
onFill
in interface BufferProcessor
onFill
in class WritableBufferedChannel
buffer
- The IO buffer to drain.args
- The optional arguments to pass back to the callbacks.IOException
public void postProcess(int drained) throws IOException
BufferedSelectionChannel
postProcess
in interface BufferProcessor
postProcess
in class BufferedSelectionChannel<WritableSelectionChannel>
drained
- The number of bytes drained or -1 if the filling source has
ended.IOException
public int write(ByteBuffer sourceBuffer) throws IOException
WritableBufferedChannel
write
in interface WritableByteChannel
write
in class WritableBufferedChannel
sourceBuffer
- The source buffer.IOException
Copyright © 2005–2013. All rights reserved.