Search in sources :

Example 1 with WARNING

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();
    }
}
Also used : StructuredDeploymentTracing(org.glassfish.internal.deployment.analysis.StructuredDeploymentTracing) ApplicationMetaDataProvider(org.glassfish.api.deployment.ApplicationMetaDataProvider) BufferedInputStream(java.io.BufferedInputStream) Event(org.glassfish.api.event.EventListener.Event) KernelLoggerInfo(org.glassfish.kernel.KernelLoggerInfo) ParsingConfig(org.glassfish.hk2.classmodel.reflect.util.ParsingConfig) TraceContext(org.glassfish.internal.deployment.analysis.TraceContext) ReadableArchive(org.glassfish.api.deployment.archive.ReadableArchive) ServerEnvironment(org.glassfish.api.admin.ServerEnvironment) FileArchive(com.sun.enterprise.deploy.shared.FileArchive) Property(org.jvnet.hk2.config.types.Property) HotDeployService(fish.payara.nucleus.hotdeploy.HotDeployService) DeploymentTracing(org.glassfish.internal.deployment.DeploymentTracing) ParameterMapExtractor(org.glassfish.common.util.admin.ParameterMapExtractor) WARNING(java.util.logging.Level.WARNING) CommonModelRegistry(org.glassfish.hk2.classmodel.reflect.util.CommonModelRegistry) com.sun.enterprise.config.serverbeans(com.sun.enterprise.config.serverbeans) MultiException(org.glassfish.hk2.api.MultiException) Service(org.jvnet.hk2.annotations.Service) Container(org.glassfish.api.container.Container) DeploymentException(org.glassfish.deployment.common.DeploymentException) ServiceLocator(org.glassfish.hk2.api.ServiceLocator) ZipOutputStream(java.util.zip.ZipOutputStream) DeploymentContextImpl(org.glassfish.deployment.common.DeploymentContextImpl) ProgressTracker(org.glassfish.internal.data.ProgressTracker) java.util(java.util) Dom(org.jvnet.hk2.config.Dom) OpsParams(org.glassfish.api.deployment.OpsParams) ClassLoaderHierarchy(org.glassfish.internal.api.ClassLoaderHierarchy) EngineRef(org.glassfish.internal.data.EngineRef) BufferedOutputStream(java.io.BufferedOutputStream) ArchiveFactory(com.sun.enterprise.deploy.shared.ArchiveFactory) ArchiveDetector(org.glassfish.api.deployment.archive.ArchiveDetector) LocalStringManagerImpl(com.sun.enterprise.util.LocalStringManagerImpl) DeploymentContext(org.glassfish.api.deployment.DeploymentContext) VersioningUtils(org.glassfish.deployment.versioning.VersioningUtils) ApplicationLifecycleInterceptor(org.glassfish.internal.deployment.ApplicationLifecycleInterceptor) Sniffer(org.glassfish.api.container.Sniffer) WritableArchive(org.glassfish.api.deployment.archive.WritableArchive) ApplicationName(org.glassfish.api.admin.config.ApplicationName) Named(javax.inject.Named) PreDestroy(org.glassfish.hk2.api.PreDestroy) DeploymentProperties(org.glassfish.deployment.common.DeploymentProperties) ApplicationConfigInfo(org.glassfish.deployment.common.ApplicationConfigInfo) ServerEnvironmentImpl(org.glassfish.server.ServerEnvironmentImpl) ExtendedDeploymentContext(org.glassfish.internal.deployment.ExtendedDeploymentContext) SingleConfigCode(org.jvnet.hk2.config.SingleConfigCode) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) ConfigSupport(org.jvnet.hk2.config.ConfigSupport) DeploymentSpan(org.glassfish.internal.deployment.analysis.DeploymentSpan) File(java.io.File) PostConstruct(org.glassfish.hk2.api.PostConstruct) Parser(org.glassfish.hk2.classmodel.reflect.Parser) MetaData(org.glassfish.api.deployment.MetaData) EngineInfo(org.glassfish.internal.data.EngineInfo) ApplicationInfo(org.glassfish.internal.data.ApplicationInfo) ApplicationRegistry(org.glassfish.internal.data.ApplicationRegistry) FileUtils(com.sun.enterprise.util.io.FileUtils) ResourceLocator(org.glassfish.hk2.classmodel.reflect.util.ResourceLocator) SpanSequence(org.glassfish.internal.deployment.analysis.SpanSequence) Events(org.glassfish.api.event.Events) DeployCommandParameters(org.glassfish.api.deployment.DeployCommandParameters) PropertyVetoException(java.beans.PropertyVetoException) ArchiveHandler(org.glassfish.api.deployment.archive.ArchiveHandler) Collectors.toMap(java.util.stream.Collectors.toMap) TransactionFailure(org.jvnet.hk2.config.TransactionFailure) URI(java.net.URI) ThreadFactory(java.util.concurrent.ThreadFactory) ZipEntry(java.util.zip.ZipEntry) ContainerRegistry(org.glassfish.internal.data.ContainerRegistry) RetryableException(org.jvnet.hk2.config.RetryableException) ClientJarWriter(org.glassfish.deployment.common.ClientJarWriter) ParameterMap(org.glassfish.api.admin.ParameterMap) Logger(java.util.logging.Logger) ConfigBeanProxy(org.jvnet.hk2.config.ConfigBeanProxy) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) ApplicationState(fish.payara.nucleus.hotdeploy.ApplicationState) DeploymentLifecycleProbeProvider(org.glassfish.deployment.monitor.DeploymentLifecycleProbeProvider) UndeployCommandParameters(org.glassfish.api.deployment.UndeployCommandParameters) DeploymentGroup(fish.payara.enterprise.config.serverbeans.DeploymentGroup) Deployment(org.glassfish.internal.deployment.Deployment) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) INFO(java.util.logging.Level.INFO) Singleton(javax.inject.Singleton) Function(java.util.function.Function) Level(java.util.logging.Level) SEVERE(java.util.logging.Level.SEVERE) ActionReport(org.glassfish.api.ActionReport) Inject(javax.inject.Inject) PayaraExecutorService(fish.payara.nucleus.executorservice.PayaraExecutorService) ExecutorService(java.util.concurrent.ExecutorService) Types(org.glassfish.hk2.classmodel.reflect.Types) FINE(java.util.logging.Level.FINE) Deployer(org.glassfish.api.deployment.Deployer) VersioningSyntaxException(org.glassfish.deployment.versioning.VersioningSyntaxException) DeploymentUtils(org.glassfish.deployment.common.DeploymentUtils) FileInputStream(java.io.FileInputStream) ModuleInfo(org.glassfish.internal.data.ModuleInfo) TimeUnit(java.util.concurrent.TimeUnit) VirtualizationEnv(org.glassfish.api.virtualization.VirtualizationEnv) ConfigBean(org.jvnet.hk2.config.ConfigBean) Transaction(org.jvnet.hk2.config.Transaction) CompositeHandler(org.glassfish.api.deployment.archive.CompositeHandler) ParsingContext(org.glassfish.hk2.classmodel.reflect.ParsingContext) InputStream(java.io.InputStream) ProgressTracker(org.glassfish.internal.data.ProgressTracker) SpanSequence(org.glassfish.internal.deployment.analysis.SpanSequence) StructuredDeploymentTracing(org.glassfish.internal.deployment.analysis.StructuredDeploymentTracing) ActionReport(org.glassfish.api.ActionReport)

Aggregations

com.sun.enterprise.config.serverbeans (com.sun.enterprise.config.serverbeans)1 ArchiveFactory (com.sun.enterprise.deploy.shared.ArchiveFactory)1 FileArchive (com.sun.enterprise.deploy.shared.FileArchive)1 LocalStringManagerImpl (com.sun.enterprise.util.LocalStringManagerImpl)1 FileUtils (com.sun.enterprise.util.io.FileUtils)1 DeploymentGroup (fish.payara.enterprise.config.serverbeans.DeploymentGroup)1 PayaraExecutorService (fish.payara.nucleus.executorservice.PayaraExecutorService)1 ApplicationState (fish.payara.nucleus.hotdeploy.ApplicationState)1 HotDeployService (fish.payara.nucleus.hotdeploy.HotDeployService)1 PropertyVetoException (java.beans.PropertyVetoException)1 BufferedInputStream (java.io.BufferedInputStream)1 BufferedOutputStream (java.io.BufferedOutputStream)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 URI (java.net.URI)1 java.util (java.util)1 ExecutorService (java.util.concurrent.ExecutorService)1