prepareRefresh method
Prepares the application context for a refresh.
This method resets lifecycle flags, records the startup timestamp, and logs that the context is being refreshed. It is invoked internally before creating a fresh pod factory.
Subclasses may override this to perform custom pre-refresh logic, such as resetting caches or preparing configuration sources.
Example:
@override
Future<void> prepareRefresh() async {
await super.prepareRefresh();
logger.info("Preparing additional refresh state");
}
This is part of Jetleaf – a framework which developers can use to build web applications.
Implementation
@protected
Future<void> prepareRefresh() async {
_startupDate = DateTime.now();
_isClosed = false;
_isActive = true;
if (logger.getIsInfoEnabled()) {
logger.info("Starting refresh of ${runtimeType} application context...");
}
}