Class DeadlineManagerLifecycleConfigurationEnhancer
- All Implemented Interfaces:
ConfigurationEnhancer
ConfigurationEnhancer that ties every DeadlineManager of the configuration to the application's
lifecycle.
It registers a decorator for the DeadlineManager type that leaves the manager as it is, and calls
DeadlineManager.shutdown() in the Phase.INBOUND_EVENT_CONNECTORS shutdown phase. Deadlines thereby
stop firing before the components that handle them shut down. In the same start phase, it calls
DbSchedulerDeadlineManager.start() on a DbSchedulerDeadlineManager, which starts its scheduler unless
startScheduler leaves that to the application. The
decorator applies to every component that is a DeadlineManager, under whichever type it is registered.
Applications therefore do not start or shut down a DeadlineManager of the configuration themselves. A
DeadlineManager may still be shut down more than once, for example when Spring calls the
shutdown() method it infers as the destroy method of a @Bean, so its implementations allow repeated
calls.
The enhancer is registered through the ServiceLoader mechanism, and can be disabled with
ComponentRegistry.disableEnhancer(Class) by an application that starts and shuts down its deadline managers
itself.
- Since:
- 5.4.0
- Author:
- Jakob Hatzl
-
Constructor Details
-
DeadlineManagerLifecycleConfigurationEnhancer
public DeadlineManagerLifecycleConfigurationEnhancer()
-
-
Method Details
-
enhance
Description copied from interface:ConfigurationEnhancer- Specified by:
enhancein interfaceConfigurationEnhancer- Parameters:
registry- The registry instance to enhance.
-