Class CachingSSLContextFactory
java.lang.Object
org.apache.activemq.artemis.core.remoting.impl.ssl.DefaultSSLContextFactory
org.apache.activemq.artemis.core.remoting.impl.ssl.CachingSSLContextFactory
- All Implemented Interfaces:
Comparable<SSLContextFactory>,SSLContextFactory
SSLContextFactory 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.SSLContextFactory file with
org.apache.activemq.artemis.core.remoting.impl.ssl.CachingSSLContextFactory as value.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected ObjectgetCacheKey(SSLContextConfig config, Map<String, Object> additionalOpts) Obtains/calculates a cache key for the correspondingSslContext.intThe priority for the SSLContextFactory when resolving the service to get the implementation.getSSLContext(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.SSLContextFactory
compareTo, getSSLContext
-
Constructor Details
-
CachingSSLContextFactory
public CachingSSLContextFactory()
-
-
Method Details
-
clearSSLContexts
public void clearSSLContexts() -
getSSLContext
public SSLContext getSSLContext(SSLContextConfig config, Map<String, Object> additionalOpts) throws Exception- Specified by:
getSSLContextin interfaceSSLContextFactory- Overrides:
getSSLContextin classDefaultSSLContextFactoryadditionalOpts- implementation specific additional options.- Returns:
- an
SSLContextfor the given configuration - Throws:
Exception
-
getCacheKey
Obtains/calculates a cache key for the correspondingSslContext.- If
configcontains an entry with key "sslContext", the associated value is returned - Otherwise, the provided
SSLContextConfigis used as cache key.
- Returns:
- the SSL context name to cache/retrieve the
SslContext
- If
-
getPriority
public int getPriority()Description copied from interface:SSLContextFactoryThe priority for the SSLContextFactory when 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 interfaceSSLContextFactory- Overrides:
getPriorityin classDefaultSSLContextFactory- Returns:
- the priority
-