finishSetup method

  1. @protected
  2. @mustCallSuper
Future<void> finishSetup(
  1. ConfigurableListablePodFactory podFactory
)

Template method invoked during setup to complete the setup process.

Subclasses can override this to perform additional initialization steps or to publish custom events.

Example:

@override
Future<void> finishRefresh() async {
logger.info("Custom finish setup logic here");
}

This is part of Jetleaf – a framework which developers can use to build web applications.

Implementation

@protected
@mustCallSuper
Future<void> finishSetup(ConfigurableListablePodFactory podFactory) async {
  await resetCommonCaches();

  // Initialize lifecycle processor
  await initializeLifecycleProcessor(podFactory);

  // Start lifecycle processor
  await getLifecycleProcessor().onRefresh();

  // Publish setup event
  await publishEvent(ContextSetupEvent.withClock(this, () => DateTime.now()));

  if (logger.getIsDebugEnabled()) {
    logger.debug("${getDisplayName()}: $runtimeType application context setup successfully.");
  }

  _isSetupReady = true;
  await publishEvent(ContextReadyEvent.withClock(this, () => DateTime.now()));

  // Publish ready event
  return Future.value();
}