use of java.util.logging.Level.WARNING in project Payara by payara.
the class ApplicationLifecycle method initialize.
@Override
public void initialize(ApplicationInfo appInfo, Collection<? extends Sniffer> sniffers, ExtendedDeploymentContext context) {
if (appInfo == null) {
return;
}
appRegistry.removeTransient(appInfo.getName());
final ActionReport report = context.getActionReport();
ProgressTracker tracker = context.getTransientAppMetaData(ExtendedDeploymentContext.TRACKER, ProgressTracker.class);
StructuredDeploymentTracing tracing = StructuredDeploymentTracing.load(context);
// associated engines and the application info is created and registered
if (loadOnCurrentInstance(context)) {
try (SpanSequence span = tracing.startSequence(DeploymentTracing.AppStage.INITIALIZE)) {
notifyLifecycleInterceptorsBefore(ExtendedDeploymentContext.Phase.START, context);
appInfo.initialize();
appInfo.getModuleInfos().forEach(moduleInfo -> moduleInfo.getEngineRefs().forEach(engineRef -> tracker.add("initialized", EngineRef.class, engineRef)));
span.start(DeploymentTracing.AppStage.START);
appInfo.start(context, tracker);
notifyLifecycleInterceptorsAfter(ExtendedDeploymentContext.Phase.START, context);
} catch (Throwable loadException) {
logger.log(SEVERE, KernelLoggerInfo.lifecycleException, loadException);
report.failure(logger, "Exception while loading the app", null);
report.setFailureCause(loadException);
tracker.actOn(logger);
} finally {
context.postDeployClean(false);
if (report.getActionExitCode() == ActionReport.ExitCode.FAILURE) {
// warning status code is not a failure
events.send(new Event<>(Deployment.DEPLOYMENT_FAILURE, context));
} else {
events.send(new Event<>(Deployment.DEPLOYMENT_SUCCESS, appInfo));
}
}
currentDeploymentContext.get().pop();
}
}
Aggregations