|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.web.connector.grizzly.TaskBase
com.sun.enterprise.web.connector.grizzly.DefaultReadTask
com.sun.enterprise.web.connector.grizzly.ssl.SSLReadTask
public class SSLReadTask
SSL support over NIO. This Task handles the SSL requests
using a non blocking socket. The SSL handshake is done using this class.
Once the handshake is successful, the SSLProcessorTask is
executed.
| Field Summary | |
|---|---|
protected int |
appBBSize
Decrypted ByteBuffer default size. |
protected boolean |
handshake
Is the handshake completed. |
protected ByteBuffer |
inputBB
The encrypted input ByteBuffer. |
protected int |
inputBBSize
Encrypted ByteBuffer default size. |
protected ByteBuffer |
outputBB
The encrupted output ByteBuffer |
protected SSLEngine |
sslEngine
The SSLEngine required to encrypt/decrypt SSL request bytes. |
protected SSLImplementation |
sslImplementation
The Coyote SSLImplementation used to retrive the SSLContext |
| Fields inherited from class com.sun.enterprise.web.connector.grizzly.DefaultReadTask |
|---|
algorithm, byteBuffer, bytesAvailable, inputStream, maxPostSize, processorTask, taskContext, taskEvent, useByteBufferView, useDirectByteBuffer |
| Fields inherited from class com.sun.enterprise.web.connector.grizzly.TaskBase |
|---|
key, listeners, pipeline, recycle, selectorThread, type |
| Fields inherited from interface com.sun.enterprise.web.connector.grizzly.Task |
|---|
ACCEPT_TASK, PROCESSOR_TASK, READ_TASK |
| Constructor Summary | |
|---|---|
SSLReadTask()
|
|
| Method Summary | |
|---|---|
void |
allocateBuffers()
Allocate themandatory ByteBuffers. |
protected void |
configureProcessorTask()
Configure the SSLProcessorTask. |
void |
detachProcessor()
Return the ProcessorTask to the pool. |
protected boolean |
doHandshake(int timeout)
Execute a non blocking SSL handshake. |
protected Object[] |
doPeerCertificateChain(boolean needClientAuth)
Get the peer certificate list by enatiating a new handshake. |
void |
doTask()
Perform an SSL handshake using an SSLEngine. |
boolean |
getHandshake()
Return the handshake status. |
ByteBuffer |
getInputBB()
Return the encrypted ByteBuffer used to handle request. |
ByteBuffer |
getOutputBB()
|
SSLEngine |
getSSLEngine()
Return the SSLEngine used by this instance. |
void |
initialize(StreamAlgorithm algorithm,
boolean useDirectByteBuffer,
boolean useByteBufferView)
Initialize this object. |
protected boolean |
process()
Process the request using the decrypted ByteBuffer. |
void |
recycle()
Recycle this object so it can be re-used. |
void |
registerKey()
Register the SelectionKey with the Selector. |
void |
setHandshake(boolean handshake)
Set true if the handshake already occured. |
void |
setInputBB(ByteBuffer inputBB)
Set the encrypted ByteBuffer used to handle request. |
void |
setOutputBB(ByteBuffer outputBB)
|
void |
setSSLEngine(SSLEngine sslEngine)
Set the SSLEngine. |
void |
setSSLImplementation(SSLImplementation sslImplementation)
Set the Coyote SSLImplemenation |
| Methods inherited from class com.sun.enterprise.web.connector.grizzly.DefaultReadTask |
|---|
attachProcessor, doTask, executeProcessorTask, finishConnection, getByteBuffer, getIdleTime, getProcessorTask, manageKeepAlive, returnTask, setByteBuffer, setBytesAvailable, setIdleTime, taskEvent, terminate |
| Methods inherited from class com.sun.enterprise.web.connector.grizzly.TaskBase |
|---|
addTaskListener, call, cancelTask, clearTaskListeners, execute, fireTaskEvent, getKeepAliveStats, getPipeline, getRecycle, getRequestGroupInfo, getSelectionKey, getSelectorThread, getSocket, getTaskListeners, getType, isMonitoringEnabled, removeTaskListener, run, setPipeline, setRecycle, setSelectionKey, setSelectorThread |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.enterprise.web.connector.grizzly.Task |
|---|
addTaskListener, cancelTask, clearTaskListeners, execute, getKeepAliveStats, getPipeline, getRecycle, getRequestGroupInfo, getSelectionKey, getSelectorThread, getTaskListeners, getType, isMonitoringEnabled, removeTaskListener, setPipeline, setRecycle, setSelectionKey, setSelectorThread |
| Methods inherited from interface java.lang.Runnable |
|---|
run |
| Methods inherited from interface java.util.concurrent.Callable |
|---|
call |
| Field Detail |
|---|
protected SSLEngine sslEngine
SSLEngine required to encrypt/decrypt SSL request bytes.
protected int appBBSize
protected int inputBBSize
protected ByteBuffer inputBB
protected ByteBuffer outputBB
protected boolean handshake
protected SSLImplementation sslImplementation
SSLContext
| Constructor Detail |
|---|
public SSLReadTask()
| Method Detail |
|---|
public void initialize(StreamAlgorithm algorithm,
boolean useDirectByteBuffer,
boolean useByteBufferView)
initialize in interface ReadTaskinitialize in class DefaultReadTaskpublic void allocateBuffers()
ByteBuffers. Since the ByteBuffer
are maintaned on the SSLWorkerThread lazily, this method
makes sure the ByteBuffers are properly allocated and configured.
public void registerKey()
SelectionKey with the Selector.
The SSLEngine is attached because it is impossible to
keep-alive an ssl connection without re-using the same SSLEngine.
registerKey in class DefaultReadTask
public void doTask()
throws IOException
doTask in interface TaskdoTask in class DefaultReadTaskIOException
protected boolean doHandshake(int timeout)
throws IOException
IOException
protected Object[] doPeerCertificateChain(boolean needClientAuth)
throws IOException
IOExceptionprotected void configureProcessorTask()
SSLProcessorTask.
configureProcessorTask in class DefaultReadTaskpublic void detachProcessor()
ProcessorTask to the pool.
detachProcessor in interface ReadTaskdetachProcessor in class DefaultReadTask
protected boolean process()
throws IOException
ByteBuffer. The
SSLProcessorTask
IOExceptionpublic void recycle()
recycle in interface Taskrecycle in class DefaultReadTaskpublic void setSSLImplementation(SSLImplementation sslImplementation)
SSLImplemenation
public void setHandshake(boolean handshake)
public boolean getHandshake()
public void setSSLEngine(SSLEngine sslEngine)
SSLEngine.
public SSLEngine getSSLEngine()
SSLEngine used by this instance.
public ByteBuffer getInputBB()
ByteBuffer used to handle request.
public void setInputBB(ByteBuffer inputBB)
ByteBuffer used to handle request.
public ByteBuffer getOutputBB()
public void setOutputBB(ByteBuffer outputBB)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||