ContextRestartedEvent constructor
ContextRestartedEvent(
- ApplicationContext source
Event published when the ApplicationContext is restarted.
This event is typically fired when the context is stopped and then started again, signaling a full lifecycle reset rather than just a refresh.
It can be useful for components that need to release and reacquire resources, reinitialize internal state, or log restart-specific metadata.
Example:
class RestartMonitor implements ApplicationListener<ContextRestartedEvent> {
@override
void onApplicationEvent(ContextRestartedEvent event) {
print("Application context restarted: ${event.getSource()}");
}
}
Implementation
ContextRestartedEvent(super.source);