Class TenantComponentParameterResolverFactoryConfigurationEnhancer

java.lang.Object
io.axoniq.framework.messaging.multitenancy.annotation.TenantComponentParameterResolverFactoryConfigurationEnhancer
All Implemented Interfaces:
ConfigurationEnhancer

@Internal public class TenantComponentParameterResolverFactoryConfigurationEnhancer extends Object implements ConfigurationEnhancer
Configuration enhancer that registers the TenantComponentParameterResolverFactory to the ComponentRegistry of the Configuration.

Contributed through the ServiceLoader, so handler parameters annotated with TenantScoped resolve as soon as the axoniq-multi-tenancy module is on the classpath. This enhancer keeps running even when multi-tenancy is switched off, because an unresolvable parameter fails handler inspection and with it the whole configuration.

Deliberately carries neither an ConfigurationEnhancer.order() nor a RegistrationScope. An earlier order makes ParameterResolverFactoryUtils.registerToComponentRegistry(ComponentRegistry, java.util.function.Function) contribute the factory as the registry's ParameterResolverFactory component rather than as a decorator on it, and a CURRENT scope stops this enhancer running again for a child registry. A child registry copies enhancers and decorators but not components, and a module resolves handler parameters with its own registry's factory, so restricting either one costs handlers inside a module their tenant-scoped parameters.

Since:
5.3.0
Author:
Jakob Hatzl
  • Constructor Details

    • TenantComponentParameterResolverFactoryConfigurationEnhancer

      public TenantComponentParameterResolverFactoryConfigurationEnhancer()
  • Method Details