Class CachingOpenSSLContextFactory
java.lang.Object
org.apache.activemq.artemis.core.remoting.impl.ssl.DefaultOpenSSLContextFactory
org.apache.activemq.artemis.core.remoting.impl.ssl.CachingOpenSSLContextFactory
- All Implemented Interfaces:
Comparable<OpenSSLContextFactory>,OpenSSLContextFactory
OpenSSLContextFactory providing a cache of SslContext. Since SslContext should be reused
instead of recreated and are thread safe. To activate it you need to allow this Service to be discovered by having a
META-INF/services/org.apache.activemq.artemis.spi.core.remoting.ssl.OpenSSLContextFactory file with
org.apache.activemq.artemis.core.remoting.impl.ssl.CachingOpenSSLContextFactory as value.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRelease any cachedSslContextinstances.io.netty.handler.ssl.SslContextgetClientSslContext(SSLContextConfig config, Map<String, Object> additionalOpts) intThe priority for theOpenSSLContextFactorywhen resolving the service to get the implementation.io.netty.handler.ssl.SslContextgetServerSslContext(SSLContextConfig config, Map<String, Object> additionalOpts) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.spi.core.remoting.ssl.OpenSSLContextFactory
compareTo
-
Constructor Details
-
CachingOpenSSLContextFactory
public CachingOpenSSLContextFactory()
-
-
Method Details
-
clearSslContexts
public void clearSslContexts()Description copied from interface:OpenSSLContextFactoryRelease any cachedSslContextinstances. -
getClientSslContext
public io.netty.handler.ssl.SslContext getClientSslContext(SSLContextConfig config, Map<String, Object> additionalOpts) throws Exception- Specified by:
getClientSslContextin interfaceOpenSSLContextFactory- Overrides:
getClientSslContextin classDefaultOpenSSLContextFactoryadditionalOpts- not used by this implementation- Returns:
- an
SslContextinstance for the given configuration - Throws:
Exception
-
getServerSslContext
public io.netty.handler.ssl.SslContext getServerSslContext(SSLContextConfig config, Map<String, Object> additionalOpts) throws Exception- Specified by:
getServerSslContextin interfaceOpenSSLContextFactory- Overrides:
getServerSslContextin classDefaultOpenSSLContextFactoryadditionalOpts- not used by this implementation- Returns:
- an
SslContextinstance for the given configuration - Throws:
Exception
-
getPriority
public int getPriority()Description copied from interface:OpenSSLContextFactoryThe priority for theOpenSSLContextFactorywhen resolving the service to get the implementation. This is used when selecting the implementation when several implementations are loaded. The highest priority implementation will be used.- Specified by:
getPriorityin interfaceOpenSSLContextFactory- Overrides:
getPriorityin classDefaultOpenSSLContextFactory
-