com.sun.grizzly.ssl
Class SSLOutputBuffer

java.lang.Object
  extended by com.sun.grizzly.tcp.http11.InternalOutputBuffer
      extended by com.sun.grizzly.http.SocketChannelOutputBuffer
          extended by com.sun.grizzly.ssl.SSLOutputBuffer
All Implemented Interfaces:
SecureOutputBuffer, FileOutputBuffer, OutputBuffer, ByteChunk.ByteOutputChannel

public class SSLOutputBuffer
extends SocketChannelOutputBuffer
implements SecureOutputBuffer

Buffer the bytes until the ByteChunk is full or the request is completed, and then delegate the SSL encryption to class SSLOutputBuffer

Author:
Jean-Francois Arcand

Nested Class Summary
protected static class SSLOutputBuffer.AsyncWriteCallbackHandlerImpl
          AsyncWriteCallbackHandler implementation, which is responsible for returning cloned ByteBuffers to the pool
 
Nested classes/interfaces inherited from class com.sun.grizzly.http.SocketChannelOutputBuffer
SocketChannelOutputBuffer.ByteBufferClonerImpl
 
Nested classes/interfaces inherited from class com.sun.grizzly.tcp.http11.InternalOutputBuffer
InternalOutputBuffer.OutputStreamOutputBuffer
 
Field Summary
 
Fields inherited from class com.sun.grizzly.http.SocketChannelOutputBuffer
ACK, asyncHttpByteBufferCloner, asyncQueueWriter, bufferPool, channel, DEFAULT_BUFFER_POOL_SIZE, discardBytes, isAsyncHttpWriteEnabled, logger, maxBufferedBytes, maxBufferPoolSize, outputByteBuffer, selectionKey
 
Fields inherited from class com.sun.grizzly.tcp.http11.InternalOutputBuffer
activeFilters, buf, committed, filterLibrary, finished, headers, lastActiveFilter, outputStream, outputStreamOutputBuffer, pos, response, socketBuffer, useSocketBuffer
 
Constructor Summary
SSLOutputBuffer(Response response, int headerBufferSize, boolean useSocketBuffer)
          Alternate constructor.
 
Method Summary
 void flushChannel(ByteBuffer bb)
          Flush the buffer by looping until the ByteBuffer is empty using SSLOutputBuffer
 SSLEngine getSSLEngine()
          Set theSSLEngine.
 boolean isSupportFileSend()
          Returns true, if OutputBuffer supports file-send mode, or false otherwise.
 void recycle()
          Recycle the output buffer.
 void setSSLEngine(SSLEngine sslEngine)
          Get theSSLEngine.
 
Methods inherited from class com.sun.grizzly.http.SocketChannelOutputBuffer
createByteBuffer, discardUpstreamBytes, endRequest, flush, flushBuffer, getAsyncQueueWriter, getChannel, getMaxBufferedBytes, getMaxBufferPoolSize, getOutputByteBuffer, getSelectionKey, isAsyncHttpWriteEnabled, realWriteBytes, reset, sendAck, sendFile, setAsyncHttpWriteEnabled, setAsyncQueueWriter, setChannel, setMaxBufferedBytes, setMaxBufferPoolSize, setSelectionKey
 
Methods inherited from class com.sun.grizzly.tcp.http11.InternalOutputBuffer
addActiveFilter, addFilter, addLastOutputFilter, clearFilters, commit, doWrite, endHeaders, getFilters, getOutputStream, nextRequest, sendHeader, sendHeader, sendHeader, sendStatus, setOutputStream, setSocketBuffer, write, write, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSLOutputBuffer

public SSLOutputBuffer(Response response,
                       int headerBufferSize,
                       boolean useSocketBuffer)
Alternate constructor.

Method Detail

getSSLEngine

public SSLEngine getSSLEngine()
Set theSSLEngine.

Specified by:
getSSLEngine in interface SecureOutputBuffer

setSSLEngine

public void setSSLEngine(SSLEngine sslEngine)
Get theSSLEngine.

Specified by:
setSSLEngine in interface SecureOutputBuffer

flushChannel

public void flushChannel(ByteBuffer bb)
                  throws IOException
Flush the buffer by looping until the ByteBuffer is empty using SSLOutputBuffer

Overrides:
flushChannel in class SocketChannelOutputBuffer
Parameters:
bb - the ByteBuffer to write.
Throws:
IOException

isSupportFileSend

public boolean isSupportFileSend()
Returns true, if OutputBuffer supports file-send mode, or false otherwise.

Specified by:
isSupportFileSend in interface FileOutputBuffer
Overrides:
isSupportFileSend in class SocketChannelOutputBuffer
Returns:
true, if OutputBuffer supports file-send mode, or false otherwise.

recycle

public void recycle()
Description copied from class: SocketChannelOutputBuffer
Recycle the output buffer. This should be called when closing the connection.

Overrides:
recycle in class SocketChannelOutputBuffer


Copyright © 2012 Oracle Corporation. All Rights Reserved.