Package io.kroxylicious.proxy.bootstrap
Class TlsCredentialSupplierManager
java.lang.Object
io.kroxylicious.proxy.bootstrap.TlsCredentialSupplierManager
- All Implemented Interfaces:
AutoCloseable
Manages the lifecycle of TLS credential supplier plugin instances.
This class handles ServiceLoader-based discovery, initialization, and cleanup
of ServerTlsCredentialSupplierFactory instances. It follows the same
pattern as FilterChainFactory, managing the factory lifecycle:
ServerTlsCredentialSupplierFactory.initialize(io.kroxylicious.proxy.tls.ServerTlsCredentialSupplierFactoryContext, C)- validate config, create shared resourcesServerTlsCredentialSupplierFactory.create(io.kroxylicious.proxy.tls.ServerTlsCredentialSupplierFactoryContext, I)- create a single shared supplier instanceServerTlsCredentialSupplierFactory.close(I)- release resources
One manager instance is created per virtual cluster during proxy startup and stored
in the VirtualClusterModel. The factory is initialized
once at cluster creation time, and a single shared supplier instance is created eagerly.
The supplier must be thread-safe as it is shared across all connections.
The manager follows the per-cluster lifecycle and is closed when the virtual cluster is shut down.
PluginConfigurationException is thrown for invalid plugin configurations at startup.
-
Constructor Summary
ConstructorsConstructorDescriptionTlsCredentialSupplierManager(PluginFactoryRegistry pfr, io.kroxylicious.proxy.config.tls.TlsCredentialSupplierConfig definition) Creates a TlsCredentialSupplierManager for the given target cluster definition. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()io.kroxylicious.proxy.tls.ServerTlsCredentialSupplierReturns the sharedServerTlsCredentialSupplierinstance, or null if no factory was configured.booleanReturns true if a TLS credential supplier factory is configured.static TlsCredentialSupplierManagerReturns an unconfigured manager singleton (null-object pattern).
-
Constructor Details
-
TlsCredentialSupplierManager
public TlsCredentialSupplierManager(PluginFactoryRegistry pfr, @Nullable io.kroxylicious.proxy.config.tls.TlsCredentialSupplierConfig definition) Creates a TlsCredentialSupplierManager for the given target cluster definition.- Parameters:
pfr- The plugin factory registry for ServiceLoader-based discoverydefinition- The TLS credential supplier definition from configuration (may be null)
-
-
Method Details
-
unconfigured
Returns an unconfigured manager singleton (null-object pattern).- Returns:
- An unconfigured manager where
isConfigured()returns false
-
getSupplier
@Nullable public io.kroxylicious.proxy.tls.ServerTlsCredentialSupplier getSupplier()Returns the sharedServerTlsCredentialSupplierinstance, or null if no factory was configured. The supplier is created once at initialization time and shared across all connections. It must be thread-safe.- Returns:
- The shared supplier instance, or null if unconfigured
-
isConfigured
public boolean isConfigured()Returns true if a TLS credential supplier factory is configured.- Returns:
- true if a factory is configured, false otherwise
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-