com.sun.grizzly.ssl
Class SSLSelectorThread

java.lang.Object
  extended by com.sun.grizzly.http.SelectorThread
      extended by com.sun.grizzly.ssl.SSLSelectorThread
All Implemented Interfaces:
GrizzlyListener, Runnable, MBeanRegistration

public class SSLSelectorThread
extends SelectorThread

SSL over NIO Selector implementation. Mainly, this class replace the clear text implementation by defining the SSL tasks counterpart: SSLReadTask, SSLProcessorTask and SSLByteBufferInputStream.

Author:
Jean-Francois Arcand

Field Summary
protected  SSLContext sslContext
          The SSLContext associated with the SSL implementation we are running on.
 
Fields inherited from class com.sun.grizzly.http.SelectorThread
activeProcessorTasks, adapter, algorithmClass, algorithmClassName, asyncExecution, asyncHandler, bufferResponse, compressableMimeTypes, compression, compressionMinSize, controller, DEFAULT_ALGORITHM, defaultAlgorithmInstalled, defaultResponseType, disableUploadTimeout, displayConfiguration, domain, enableNioLogging, fileCacheFactory, forcedRequestType, forceKeepAlive, globalRequestProcessor, globalRequestProcessorName, inet, initialized, isAsyncHttpWriteEnabled, isFileCacheEnabled, isLargeFileCacheEnabled, isMonitoringEnabled, keepAliveStats, keepAliveThreadCount, linger, logger, maxCacheEntries, maxEntrySize, maxHttpHeaderSize, maxLargeFileCacheSize, maxPostSize, maxSmallFileCacheSize, minEntrySize, mserver, noCompressionUserAgents, oname, oOBInline, port, portUnificationFilter, processorTaskFactory, processorTasks, processorWorkerThreadName, properties, rcmSupport, readThreadsCount, requestBufferSize, restrictedUserAgents, rootFolder, running, secondsMaxAge, selector, selectorHandler, selectorThreads, selectorTimeout, SERVER_NAME, serverTimeout, sm, socketTimeout, ssBackLog, tcpNoDelay, threadPool, threadPoolStat, transactionTimeout, uploadTimeout, useByteBufferView, useDirectByteBuffer
 
Constructor Summary
SSLSelectorThread()
           
 
Method Summary
protected  void configureFilters(ProtocolChain protocolChain)
          Adds and configures ProtocolChain's filters
protected  FileCacheFactory createFileCacheFactory()
          Create SSL aware FileCacheFactory
protected  ProtocolFilter createHttpParserFilter()
          Create HTTP parser ProtocolFilter
protected  TCPSelectorHandler createSelectorHandler()
          Create TCPSelectorHandler
 String[] getEnabledCipherSuites()
          Returns the list of cipher suites to be enabled when SSLEngine is initialized.
 String[] getEnabledProtocols()
          Returns the list of protocols to be enabled when SSLEngine is initialized.
 SSLContext getSSLContext()
          Return the SSLContext required to support SSL over NIO.
 SSLImplementation getSSLImplementation()
          Return the current SSLImplementation this Thread
protected  void initFileCacheFactory()
          Initialize the fileCacheFactory associated with this instance
 boolean isClientMode()
          Returns true if the SSlEngine is set to use client mode when handshaking.
 boolean isNeedClientAuth()
          Returns true if the SSLEngine will require client authentication.
 boolean isWantClientAuth()
          Returns true if the engine will request client authentication.
protected  ProcessorTask newProcessorTask(boolean initialize)
          Create SSLProcessorTask objects and configure it to be ready to proceed request.
 void setClientMode(boolean clientMode)
          Configures the engine to use client (or server) mode when handshaking.
 void setEnabledCipherSuites(String[] enabledCipherSuites)
          Sets the list of cipher suites to be enabled when SSLEngine is initialized.
 void setEnabledProtocols(String[] enabledProtocols)
          Sets the list of protocols to be enabled when SSLEngine is initialized.
 void setNeedClientAuth(boolean needClientAuth)
          Configures the engine to require client authentication.
 void setSSLConfig(SSLConfig sslConfig)
          Set the SSLContext required to support SSL over NIO.
 void setSSLContext(SSLContext sslContext)
          Set the SSLContext required to support SSL over NIO.
 void setSSLImplementation(SSLImplementation sslImplementation)
          Set the Coyote SSLImplementation.
 void setWantClientAuth(boolean wantClientAuth)
          Configures the engine to request client authentication.
 
Methods inherited from class com.sun.grizzly.http.SelectorThread
addAsyncEnabledContextPath, cancelKey, clearTasks, configureCompression, configureFileCacheFactory, configurePortUnification, configurePortUnification, configureProcessorTask, configureProtocolChain, configureSelectorHandler, createKeepAliveStats, createRaFilter, createSelectionKeyHandler, disableMonitoring, disableThreadPoolStats, enableMonitoring, enableRcmSupport, enableThreadPoolStats, getActiveProcessorTasks, getAdapter, getAddress, getAlgorithmClassName, getAsyncHandler, getBufferResponse, getBufferSize, getClassLoader, getCompressableMimeTypes, getCompression, getCompressionMinSize, getController, getCoreThreads, getDefaultResponseType, getDisableUploadTimeout, getDomain, getEnableAsyncExecution, getForcedRequestType, getForceKeepAlive, getInet, getKeepAliveStats, getKeepAliveTimeoutInSeconds, getLargeFileCacheEnabled, getLinger, getManagement, getMaxCacheEntries, getMaxEntrySize, getMaxHttpHeaderSize, getMaxKeepAliveRequests, getMaxLargeCacheSize, getMaxPostSize, getMaxSmallCacheSize, getMaxThreads, getMinEntrySize, getNoCompressionUserAgents, getObjectName, getPort, getPortLowLevel, getProcessorTask, getProcessorTaskFactory, getProperty, getProtocolChain, getRequestGroupInfo, getRestrictedUserAgents, getReuseAddress, getSelector, getSelector, getSelector, getSelectorHandler, getSelectorReadThreadsCount, getSelectors, getSelectorThreadKeyHandler, getSelectorTimeout, getSendBufferSize, getServerTimeout, getSocketTimeout, getSsBackLog, getTcpNoDelay, getThreadPool, getThreadPoolClassname, getTransactionTimeout, getUploadTimeout, getWebAppRootPath, initAlgorithm, initController, initEndpoint, initMonitoringLevel, initProcessorTask, initThreadPool, isAsyncHttpWriteEnabled, isEnableNioLogging, isFileCacheEnabled, isMonitoringEnabled, isRcmSupported, isRunning, isUseByteBufferView, isUseChunking, isUseDirectByteBuffer, listen, logger, newThreadPool, postDeregister, postRegister, preDeregister, preRegister, protocol, rampUpProcessorTask, reconfigureAdapter, reconfigureAsyncExecution, registerComponents, registerKey, removeCacheEntry, removeProperty, returnTask, run, setAdapter, setAddress, setAlgorithmClassName, setAsyncHandler, setAsyncHttpWriteEnabled, setBufferResponse, setBufferSize, setClassLoader, setCompressableMimeTypes, setCompression, setCompressionMinSize, setController, setCoreThreads, setDefaultResponseType, setDisableUploadTimeout, setDisplayConfiguration, setEnableAsyncExecution, setEnableNioLogging, setFileCacheIsEnabled, setForcedRequestType, setForceKeepAlive, setInet, setKeepAliveTimeoutInSeconds, setLargeFileCacheEnabled, setLinger, setLogger, setManagement, setMaxCacheEntries, setMaxEntrySize, setMaxHttpHeaderSize, setMaxKeepAliveRequests, setMaxLargeCacheSize, setMaxPostSize, setMaxSmallCacheSize, setMaxThreads, setMinEntrySize, setNoCompressionUserAgents, setPort, setProcessorTaskFactory, setProperty, setRestrictedUserAgents, setReuseAddress, setSecondsMaxAge, setSelectorReadThreadsCount, setSelectorTimeout, setSendBufferSize, setServerTimeout, setSocketOptions, setSocketTimeout, setSsBackLog, setTcpNoDelay, setThreadPool, setThreadPoolClassname, setTransactionTimeout, setUploadTimeout, setUseByteBufferView, setUseChunking, setUseDirectByteBuffer, setWebAppRootPath, start, startEndpoint, startListener, startThreadPool, stopEndpoint, stopThreadPool, unregisterComponents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sslContext

protected SSLContext sslContext
The SSLContext associated with the SSL implementation we are running on.

Constructor Detail

SSLSelectorThread

public SSLSelectorThread()
Method Detail

createSelectorHandler

protected TCPSelectorHandler createSelectorHandler()
Create TCPSelectorHandler

Overrides:
createSelectorHandler in class SelectorThread

createHttpParserFilter

protected ProtocolFilter createHttpParserFilter()
Create HTTP parser ProtocolFilter

Overrides:
createHttpParserFilter in class SelectorThread
Returns:
HTTP parser ProtocolFilter

configureFilters

protected void configureFilters(ProtocolChain protocolChain)
Adds and configures ProtocolChain's filters

Overrides:
configureFilters in class SelectorThread

newProcessorTask

protected ProcessorTask newProcessorTask(boolean initialize)
Create SSLProcessorTask objects and configure it to be ready to proceed request.

Overrides:
newProcessorTask in class SelectorThread

setSSLConfig

public void setSSLConfig(SSLConfig sslConfig)
Set the SSLContext required to support SSL over NIO.


setSSLContext

public void setSSLContext(SSLContext sslContext)
Set the SSLContext required to support SSL over NIO.


getSSLContext

public SSLContext getSSLContext()
Return the SSLContext required to support SSL over NIO.


setSSLImplementation

public void setSSLImplementation(SSLImplementation sslImplementation)
Set the Coyote SSLImplementation.


getSSLImplementation

public SSLImplementation getSSLImplementation()
Return the current SSLImplementation this Thread


getEnabledCipherSuites

public String[] getEnabledCipherSuites()
Returns the list of cipher suites to be enabled when SSLEngine is initialized.

Returns:
null means 'use SSLEngine's default.'

setEnabledCipherSuites

public void setEnabledCipherSuites(String[] enabledCipherSuites)
Sets the list of cipher suites to be enabled when SSLEngine is initialized.

Parameters:
enabledCipherSuites - null means 'use SSLEngine's default.'

getEnabledProtocols

public String[] getEnabledProtocols()
Returns the list of protocols to be enabled when SSLEngine is initialized.

Returns:
null means 'use SSLEngine's default.'

setEnabledProtocols

public void setEnabledProtocols(String[] enabledProtocols)
Sets the list of protocols to be enabled when SSLEngine is initialized.

Parameters:
enabledProtocols - null means 'use SSLEngine's default.'

isClientMode

public boolean isClientMode()
Returns true if the SSlEngine is set to use client mode when handshaking.

Returns:
is client mode enabled

setClientMode

public void setClientMode(boolean clientMode)
Configures the engine to use client (or server) mode when handshaking.


isNeedClientAuth

public boolean isNeedClientAuth()
Returns true if the SSLEngine will require client authentication.


setNeedClientAuth

public void setNeedClientAuth(boolean needClientAuth)
Configures the engine to require client authentication.


isWantClientAuth

public boolean isWantClientAuth()
Returns true if the engine will request client authentication.


setWantClientAuth

public void setWantClientAuth(boolean wantClientAuth)
Configures the engine to request client authentication.


initFileCacheFactory

protected void initFileCacheFactory()
Initialize the fileCacheFactory associated with this instance

Overrides:
initFileCacheFactory in class SelectorThread

createFileCacheFactory

protected FileCacheFactory createFileCacheFactory()
Create SSL aware FileCacheFactory

Overrides:
createFileCacheFactory in class SelectorThread


Copyright © 2012 Oracle Corporation. All Rights Reserved.