Class CustomInjectorRegistryFactory

java.lang.Object
tech.guilhermekaua.spigotboot.core.context.dependency.injector.CustomInjectorRegistryFactory
All Implemented Interfaces:
BeanDefinitionsReadyListener, Ordered

public class CustomInjectorRegistryFactory extends Object implements BeanDefinitionsReadyListener, Ordered
Factory component that applies CustomInjectorRegistryCustomizer beans to the framework's CustomInjectorRegistry during context initialization.

This factory runs in the DEFINITIONS_READY phase, after all bean definitions have been discovered but before instantiation begins. This ensures custom injectors are registered and available for normal dependency injection.

The factory:

  1. Obtains the framework's registry instance from the DependencyManager
  2. Resolves all CustomInjectorRegistryCustomizer beans
  3. Sorts customizers by their Ordered.getOrder() value
  4. Applies each customizer to the registry in order
See Also:
  • Constructor Details

    • CustomInjectorRegistryFactory

      public CustomInjectorRegistryFactory()
  • Method Details

    • onBeanDefinitionsReady

      public void onBeanDefinitionsReady(@NotNull @NotNull Context context, @NotNull @NotNull BeanDefinitionRegistry definitionRegistry, @NotNull @NotNull BeanRegistrar registrar)
      Description copied from interface: BeanDefinitionsReadyListener
      Called when all bean definitions have been discovered and registered, but before instantiation begins.
      Specified by:
      onBeanDefinitionsReady in interface BeanDefinitionsReadyListener
      Parameters:
      context - the context
      definitionRegistry - registry containing all bean definitions; while writable, callers should prefer using the provided registrar for adding definitions
      registrar - registrar to add new bean definitions
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface Ordered