public class SslConnectionFactory extends AbstractConnectionFactory implements ConnectionFactory.Detecting
AbstractLifeCycle.AbstractLifeCycleListener
ConnectionFactory.Detecting.Detection
ConnectionFactory.Detecting, ConnectionFactory.Upgrading
Container.InheritedListener, Container.Listener
LifeCycle.Listener
Modifier and Type | Field and Description |
---|---|
private boolean |
_directBuffersForDecryption |
private boolean |
_directBuffersForEncryption |
private java.lang.String |
_nextProtocol |
private SslContextFactory |
_sslContextFactory |
private static int |
TLS_ALERT_FRAME_TYPE |
private static int |
TLS_HANDSHAKE_FRAME_TYPE |
private static int |
TLS_MAJOR_VERSION |
Constructor and Description |
---|
SslConnectionFactory() |
SslConnectionFactory(SslContextFactory factory,
java.lang.String nextProtocol) |
SslConnectionFactory(java.lang.String nextProtocol) |
Modifier and Type | Method and Description |
---|---|
protected AbstractConnection |
configure(AbstractConnection connection,
Connector connector,
EndPoint endPoint) |
ConnectionFactory.Detecting.Detection |
detect(java.nio.ByteBuffer buffer)
Check the bytes in the given
buffer to figure out if this ConnectionFactory.Detecting instance
can work with them or not. |
protected void |
doStart()
Starts the managed lifecycle beans in the order they were added.
|
java.lang.String |
getNextProtocol() |
SslContextFactory |
getSslContextFactory() |
boolean |
isDirectBuffersForDecryption() |
boolean |
isDirectBuffersForEncryption() |
Connection |
newConnection(Connector connector,
EndPoint endPoint)
Creates a new
Connection with the given parameters |
protected SslConnection |
newSslConnection(Connector connector,
EndPoint endPoint,
javax.net.ssl.SSLEngine engine) |
void |
setDirectBuffersForDecryption(boolean useDirectBuffers) |
void |
setDirectBuffersForEncryption(boolean useDirectBuffers) |
java.lang.String |
toString() |
findNextProtocol, findNextProtocol, getFactories, getInputBufferSize, getProtocol, getProtocols, setInputBufferSize
addBean, addBean, addEventListener, addManaged, contains, destroy, doStop, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getProtocol, getProtocols
dumpContainer, dumpIterable, dumpMapEntries, dumpObjects, dumpSelf, named
private static final int TLS_ALERT_FRAME_TYPE
private static final int TLS_HANDSHAKE_FRAME_TYPE
private static final int TLS_MAJOR_VERSION
private final SslContextFactory _sslContextFactory
private final java.lang.String _nextProtocol
private boolean _directBuffersForEncryption
private boolean _directBuffersForDecryption
public SslConnectionFactory()
public SslConnectionFactory(@Name(value="sslContextFactory") SslContextFactory factory, @Name(value="next") java.lang.String nextProtocol)
public SslContextFactory getSslContextFactory()
public void setDirectBuffersForEncryption(boolean useDirectBuffers)
public void setDirectBuffersForDecryption(boolean useDirectBuffers)
public boolean isDirectBuffersForDecryption()
public boolean isDirectBuffersForEncryption()
public java.lang.String getNextProtocol()
protected void doStart() throws java.lang.Exception
ContainerLifeCycle
doStart
in class ContainerLifeCycle
java.lang.Exception
public ConnectionFactory.Detecting.Detection detect(java.nio.ByteBuffer buffer)
ConnectionFactory.Detecting
Check the bytes in the given buffer
to figure out if this ConnectionFactory.Detecting
instance
can work with them or not.
The buffer
MUST be left untouched by this method: bytes MUST NOT be consumed and MUST NOT be modified.
detect
in interface ConnectionFactory.Detecting
buffer
- the buffer.ConnectionFactory.Detecting.Detection.RECOGNIZED
if this ConnectionFactory.Detecting
instance can work with the bytes in the bufferConnectionFactory.Detecting.Detection.NOT_RECOGNIZED
if this ConnectionFactory.Detecting
instance cannot work with the bytes in the bufferConnectionFactory.Detecting.Detection.NEED_MORE_BYTES
if this ConnectionFactory.Detecting
instance requires more bytes to make a decisionpublic Connection newConnection(Connector connector, EndPoint endPoint)
ConnectionFactory
Creates a new Connection
with the given parameters
newConnection
in interface ConnectionFactory
connector
- The Connector
creating this connectionendPoint
- the EndPoint
associated with the connectionConnection
protected SslConnection newSslConnection(Connector connector, EndPoint endPoint, javax.net.ssl.SSLEngine engine)
protected AbstractConnection configure(AbstractConnection connection, Connector connector, EndPoint endPoint)
configure
in class AbstractConnectionFactory
public java.lang.String toString()
toString
in class AbstractConnectionFactory