postProcessFactory abstract method

Future<void> postProcessFactory(
  1. ConfigurableListablePodFactory podFactory
)

Factory hook that allows for custom modification of an application context's pod definitions, adapting the pod property values of the context's underlying pod factory.

This interface is called after all pod definitions have been loaded but before any pods have been instantiated. It allows for overriding or adding properties to pod definitions.

It supports two types of constructors:

  • No-Args: Meaning that there will no arguments in the constructor.
  • One-Arg: Meaning that there will be only one argument in the constructor of type Environment

Usage Example

class PropertyPlaceholderPostProcessor implements PodFactoryPostProcessor {
  @override
  Future<void> processFactory(ConfigurableListablePodFactory podFactory) {
    final podNames = podFactory.getPodDefinitionNames();
    for (final name in podNames) {
      final definition = podFactory.getPodDefinition(name);
      processPlaceholders(definition);
    }
  }
}

Modify the application context's internal pod factory after its standard initialization.

All pod definitions will have been loaded, but no pods will have been instantiated yet. This allows for overriding or adding properties even to eager-initializing pods.

Parameters

  • podFactory: The pod factory used by the application context

Implementation

Future<void> postProcessFactory(ConfigurableListablePodFactory podFactory);