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
public class CachingOpenSSLContextFactory extends DefaultOpenSSLContextFactory
OpenSSLContextFactoryproviding a cache ofSslContext. SinceSslContextshould be reused instead of recreated and are thread safe. To activate it you need to allow this Service to be discovered by having aMETA-INF/services/org.apache.activemq.artemis.spi.core.remoting.ssl.OpenSSLContextFactoryfile withorg.apache.activemq.artemis.core.remoting.impl.ssl.CachingOpenSSLContextFactoryas value.
-
-
Field Summary
-
Fields inherited from interface org.apache.activemq.artemis.spi.core.remoting.ssl.OpenSSLContextFactory
log
-
-
Constructor Summary
Constructors Constructor Description CachingOpenSSLContextFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearSslContexts()Release any cachedSslContextinstances.io.netty.handler.ssl.SslContextgetClientSslContext(SSLContextConfig config, Map<String,Object> additionalOpts)intgetPriority()The 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, wait
-
Methods inherited from interface org.apache.activemq.artemis.spi.core.remoting.ssl.OpenSSLContextFactory
compareTo
-
-
-
-
Method Detail
-
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
-
-