Class TenantComponentParameterResolverFactory

java.lang.Object
io.axoniq.framework.messaging.multitenancy.annotation.TenantComponentParameterResolverFactory
All Implemented Interfaces:
ParameterResolverFactory

@Internal public class TenantComponentParameterResolverFactory extends Object implements ParameterResolverFactory
ParameterResolverFactory injecting tenant-scoped components into message-handling methods.

For each handler parameter it looks for a registered TenantComponentProvider whose component type fits the parameter type. When one is found, the resolved parameter value is that provider's instance for the tenant of the message being handled. The tenant is derived from the current ProcessingContext (see RegisterTenantDescriptorHandlerInterceptor).

Registering several providers (one per component type) is supported: each parameter is matched to the provider for its own type. A single exact type match settles the choice, even when assignable supertype candidates exist. When the choice cannot be settled by an exact match, handler inspection fails with an AxonConfigurationException, since silently picking one of the candidates could hand the handler the wrong tenant-scoped resource.

Since:
5.3.0
Author:
Theo Emanuelsson, Jan Galinski, Laura Devriendt, Jakob Hatzl
See Also:
  • Constructor Details

    • TenantComponentParameterResolverFactory

      public TenantComponentParameterResolverFactory(Configuration configuration)
      Constructs a TenantComponentParameterResolverFactory for the given configuration.

      The given configuration supplies the registered providers matched against handler parameters. The tenant itself is read from the ProcessingContext of the message being handled.

      Parameters:
      configuration - the configuration to look up the registered tenant-component providers, must not be null
  • Method Details