Control-flow access beans through GeoServerExtensions in BeanFactoryPostProcessor callbacks

Description

Control-flow access beans through GeoServerExtensions in BeanFactoryPostProcessor callbacks, this may provoke premature beans instantiations provoking Spring beans initialization errors:
https://github.com/geoserver/geoserver/blob/master/src/extension/control-flow/src/main/java/org/geoserver/flow/ControlFlowCallback.java#L192-L236

A way to reproduce this problem is to use control-flow extension along with geofence-server module, geofence-server properties placeholders will not be properly initialized before geofence-server beans instantiation.

Note that BeanFactoryPostProcessor JavaDoc actually warns us against this:

It seems to me that the only propose of the current callbacks is to make sure that Spring beans are actually created when the default FlowControllerProvider and default ControlFlowConfigurator are used so this beans can later be retrieved using the GeoExtensions class.

A use case that justify this is when the importer needs to find all the beans that implement the GeoServerPluginConfigurator interface.

Environment

None

Assignee

Nuno Oliveira

Reporter

Nuno Oliveira

Triage

None

Fix versions

Affects versions

None

Components

Priority

Medium
Configure