Class TenantComponentProviderUtil

java.lang.Object
io.axoniq.framework.messaging.multitenancy.configuration.TenantComponentProviderUtil

@Internal public final class TenantComponentProviderUtil extends Object
Finds TenantComponentProviders registered in a configuration hierarchy.

Internal because providers are application components while this class only implements the framework's discovery rules for infrastructure that consumes them.

Since:
5.3.1
Author:
Jan Galinski
  • Method Details

    • all

      public static Iterable<TenantComponentProvider> all(Configuration configuration)
      Returns every tenant-component provider visible from the given configuration.
      Parameters:
      configuration - the configuration from which to resolve the root configuration
      Returns:
      every provider registered in the root configuration and its modules
    • find

      public static <T> Optional<TenantComponentProvider<T>> find(Configuration configuration, Class<T> componentType)
      Finds the provider registered for the given component type.
      Type Parameters:
      T - the component type
      Parameters:
      configuration - the configuration from which to resolve providers
      componentType - the component type of the provider to find
      Returns:
      the provider for the component type, if one is registered
      Throws:
      AxonConfigurationException - if more than one provider exposes the component type