initLifecycleProcessor method
Initializes the LifecycleProcessor
for this context.
By default, it registers a DefaultLifecycleProcessor
in the pod factory.
Subclasses can override to supply a different lifecycle strategy.
This is part of Jetleaf – a framework which developers can use to build web applications.
Implementation
@protected
Future<void> initLifecycleProcessor() async {
if (podFactory != null && await containsLocalPod(LIFECYCLE_PROCESSOR_POD_NAME)) {
_lifecycleProcessor = await getPod(LIFECYCLE_PROCESSOR_POD_NAME);
} else {
final dlp = Class<DefaultLifecycleProcessor>(null, PackageNames.CORE);
_lifecycleProcessor = DefaultLifecycleProcessor(podFactory);
await registerSingleton(
LIFECYCLE_PROCESSOR_POD_NAME,
Class<DefaultLifecycleProcessor>(),
object: ObjectHolder<LifecycleProcessor>(
_lifecycleProcessor!,
packageName: PackageNames.CORE,
qualifiedName: dlp.getQualifiedName()
)
);
}
return Future.value();
}