Class TlsCredentialSupplierManager

java.lang.Object
io.kroxylicious.proxy.bootstrap.TlsCredentialSupplierManager
All Implemented Interfaces:
AutoCloseable

public class TlsCredentialSupplierManager extends Object implements 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:

  1. ServerTlsCredentialSupplierFactory.initialize(io.kroxylicious.proxy.tls.ServerTlsCredentialSupplierFactoryContext, C) - validate config, create shared resources
  2. ServerTlsCredentialSupplierFactory.create(io.kroxylicious.proxy.tls.ServerTlsCredentialSupplierFactoryContext, I) - create a single shared supplier instance
  3. ServerTlsCredentialSupplierFactory.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 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 discovery
      definition - The TLS credential supplier definition from configuration (may be null)
  • Method Details

    • unconfigured

      public static TlsCredentialSupplierManager 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 shared ServerTlsCredentialSupplier instance, 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:
      close in interface AutoCloseable