Package org.glassfish.internal.deployment

Examples of org.glassfish.internal.deployment.DeploymentTracing


    public void start(
        ExtendedDeploymentContext context,
        ProgressTracker tracker) throws Exception {

        DeploymentTracing tracing = context.getModuleMetaData(DeploymentTracing.class);
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.START);
        }
       
        super.start(context, tracker);
        // registers all deployed items.
        for (ModuleInfo module : getModuleInfos()) {
            if (tracing!=null) {
                tracing.addModuleMark(DeploymentTracing.ModuleMark.START, module.getName());
            }
            module.start(getSubContext(module, context), tracker);
            if (tracing!=null) {
                tracing.addModuleMark(
                    DeploymentTracing.ModuleMark.STARTED, module.getName());
            }

        }
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.START_EVENTS);
        }

        if (events!=null) {
            events.send(new Event<ApplicationInfo>(Deployment.APPLICATION_STARTED, this), false);
        }
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.STARTED);
        }

    }
View Full Code Here


    }

    public void load(ExtendedDeploymentContext context, ProgressTracker tracker) throws Exception {
        Logger logger = context.getLogger();
        context.setPhase(ExtendedDeploymentContext.Phase.LOAD);
        DeploymentTracing tracing = context.getModuleMetaData(DeploymentTracing.class);
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.LOAD);
        }

        moduleClassLoader = context.getClassLoader();

        Set<EngineRef> filteredEngines = new LinkedHashSet<EngineRef>();

        ClassLoader currentClassLoader  = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(context.getClassLoader());
            for (EngineRef engine : _getEngineRefs()) {
   
                final EngineInfo engineInfo = engine.getContainerInfo();

                if (tracing!=null) {
                    tracing.addContainerMark(DeploymentTracing.ContainerMark.LOAD,
                        engineInfo.getSniffer().getModuleType());
                }
               
                // get the container.
                Deployer deployer = engineInfo.getDeployer();

                try {
                   ApplicationContainer appCtr = deployer.load(engineInfo.getContainer(), context);
                   if (appCtr==null) {
                       String msg = "Cannot load application in " + engineInfo.getContainer().getName() + " container";
                       logger.fine(msg);
                       continue;
                   }
                   engine.load(context, tracker);
                   engine.setApplicationContainer(appCtr);
                   filteredEngines.add(engine);
                } catch(Exception e) {
                    logger.log(Level.SEVERE, "Exception while invoking " + deployer.getClass() + " load method", e);
                    throw e;
                }
                if (tracing!=null) {
                    tracing.addContainerMark(DeploymentTracing.ContainerMark.LOADED,
                        engineInfo.getSniffer().getModuleType());
                }

            }
            engines = filteredEngines;
            if (tracing!=null) {
                tracing.addMark(DeploymentTracing.Mark.LOAD_EVENTS);
            }

            if (events!=null) {
                events.send(new Event<ModuleInfo>(Deployment.MODULE_LOADED, this), false);
            }
            if (tracing!=null) {
                tracing.addMark(DeploymentTracing.Mark.LOADED);
            }
        } finally {
            Thread.currentThread().setContextClassLoader(currentClassLoader);
        }
View Full Code Here

            // registers all deployed items.
            for (EngineRef engine : _getEngineRefs()) {
                if (logger.isLoggable(Level.FINE)) {
                    logger.fine("starting " + engine.getContainerInfo().getSniffer().getModuleType());
                }
                DeploymentTracing tracing = context.getModuleMetaData(DeploymentTracing.class);
                if (tracing!=null) {
                    tracing.addContainerMark(DeploymentTracing.ContainerMark.START,
                        engine.getContainerInfo().getSniffer().getModuleType());
                }

                try {
                    if (!engine.start( context, tracker)) {
                        logger.log(Level.SEVERE, "Module not started " +  engine.getApplicationContainer().toString());
                        throw new Exception( "Module not started " +  engine.getApplicationContainer().toString());
                    }
                } catch(Exception e) {
                    logger.log(Level.SEVERE, "Exception while invoking " + engine.getApplicationContainer().getClass() + " start method", e);
                    throw e;
                }
                if (tracing!=null) {
                    tracing.addContainerMark(DeploymentTracing.ContainerMark.STARTED,
                        engine.getContainerInfo().getSniffer().getModuleType());
                }
            }
            started=true;
            if (events!=null) {
View Full Code Here

            logger.fine("Application is already loaded.");
            return;
        }

        context.setPhase(ExtendedDeploymentContext.Phase.LOAD);
        DeploymentTracing tracing = context.getModuleMetaData(DeploymentTracing.class);
        if (tracing!=null) {
            tracing.addMark(
                DeploymentTracing.Mark.LOAD);
        }


        super.load(context, tracker);

        appClassLoader = context.getClassLoader();

        for (ModuleInfo module : modules) {
            if (tracing!=null) {
                tracing.addModuleMark(DeploymentTracing.ModuleMark.LOAD, module.getName());
            }
            module.load(getSubContext(module,context), tracker);
            if (tracing!=null) {
                tracing.addModuleMark(DeploymentTracing.ModuleMark.LOADED, module.getName());
            }
        }

        isLoaded = true;

        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.LOAD_EVENTS);
        }

        if (events!=null) {
            events.send(new Event<ApplicationInfo>(Deployment.APPLICATION_LOADED, this), false);
        }
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.LOADED);
        }
       
    }
View Full Code Here

    public void start(
        ExtendedDeploymentContext context,
        ProgressTracker tracker) throws Exception {

        DeploymentTracing tracing = context.getModuleMetaData(DeploymentTracing.class);
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.START);
        }
       
        super.start(context, tracker);
        // registers all deployed items.
        for (ModuleInfo module : getModuleInfos()) {
            if (tracing!=null) {
                tracing.addModuleMark(DeploymentTracing.ModuleMark.START, module.getName());
            }
            module.start(getSubContext(module, context), tracker);
            if (tracing!=null) {
                tracing.addModuleMark(
                    DeploymentTracing.ModuleMark.STARTED, module.getName());
            }

        }
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.START_EVENTS);
        }

        if (events!=null) {
            events.send(new Event<ApplicationInfo>(Deployment.APPLICATION_STARTED, this), false);
        }
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.STARTED);
        }

    }
View Full Code Here

            logger.fine("Application is already loaded.");
            return;
        }

        context.setPhase(ExtendedDeploymentContext.Phase.LOAD);
        DeploymentTracing tracing = context.getModuleMetaData(DeploymentTracing.class);
        if (tracing!=null) {
            tracing.addMark(
                DeploymentTracing.Mark.LOAD);
        }


        super.load(context, tracker);

        appClassLoader = context.getClassLoader();

        for (ModuleInfo module : modules) {
            if (tracing!=null) {
                tracing.addModuleMark(DeploymentTracing.ModuleMark.LOAD, module.getName());
            }
            module.load(getSubContext(module,context), tracker);
            if (tracing!=null) {
                tracing.addModuleMark(DeploymentTracing.ModuleMark.LOADED, module.getName());
            }
        }
       
        populateApplicationServiceLocator();

        isLoaded = true;

        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.LOAD_EVENTS);
        }

        if (events!=null) {
            events.send(new Event<ApplicationInfo>(Deployment.APPLICATION_LOADED, this), false);
        }
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.LOADED);
        }
       
    }
View Full Code Here

    public void start(
        ExtendedDeploymentContext context,
        ProgressTracker tracker) throws Exception {

        DeploymentTracing tracing = context.getModuleMetaData(DeploymentTracing.class);
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.START);
        }
       
        super.start(context, tracker);
        // registers all deployed items.
        for (ModuleInfo module : getModuleInfos()) {
            if (tracing!=null) {
                tracing.addModuleMark(DeploymentTracing.ModuleMark.START, module.getName());
            }
            module.start(getSubContext(module, context), tracker);
            if (tracing!=null) {
                tracing.addModuleMark(
                    DeploymentTracing.ModuleMark.STARTED, module.getName());
            }

        }
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.START_EVENTS);
        }

        if (events!=null) {
            events.send(new Event<ApplicationInfo>(Deployment.APPLICATION_STARTED, this), false);
        }
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.STARTED);
        }

    }
View Full Code Here

            logger.fine("Application is already loaded.");
            return;
        }

        context.setPhase(ExtendedDeploymentContext.Phase.LOAD);
        DeploymentTracing tracing = context.getModuleMetaData(DeploymentTracing.class);
        if (tracing!=null) {
            tracing.addMark(
                DeploymentTracing.Mark.LOAD);
        }


        super.load(context, tracker);

        appClassLoader = context.getClassLoader();

        for (ModuleInfo module : modules) {
            if (tracing!=null) {
                tracing.addModuleMark(DeploymentTracing.ModuleMark.LOAD, module.getName());
            }
            module.load(getSubContext(module,context), tracker);
            if (tracing!=null) {
                tracing.addModuleMark(DeploymentTracing.ModuleMark.LOADED, module.getName());
            }
        }

        isLoaded = true;

        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.LOAD_EVENTS);
        }

        if (events!=null) {
            events.send(new Event<ApplicationInfo>(Deployment.APPLICATION_LOADED, this), false);
        }
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.LOADED);
        }
       
    }
View Full Code Here

    public void start(
        ExtendedDeploymentContext context,
        ProgressTracker tracker) throws Exception {

        DeploymentTracing tracing = context.getModuleMetaData(DeploymentTracing.class);
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.START);
        }
       
        super.start(context, tracker);
        // registers all deployed items.
        for (ModuleInfo module : getModuleInfos()) {
            if (tracing!=null) {
                tracing.addModuleMark(DeploymentTracing.ModuleMark.START, module.getName());
            }
            module.start(getSubContext(module, context), tracker);
            if (tracing!=null) {
                tracing.addModuleMark(
                    DeploymentTracing.ModuleMark.STARTED, module.getName());
            }

        }
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.START_EVENTS);
        }

        if (events!=null) {
            events.send(new Event<ApplicationInfo>(Deployment.APPLICATION_STARTED, this), false);
        }
        if (tracing!=null) {
            tracing.addMark(DeploymentTracing.Mark.STARTED);
        }

    }
View Full Code Here

                archive.exists("WEB-INF/web.xml") ||
                archive.exists("META-INF/ejb-jar.xml") ||
                archive.exists("META-INF/application-client.xml") ||
                archive.exists("META-INF/ra.xml")) {
                application = applicationFactory.createApplicationFromStandardDD(archive);
                DeploymentTracing tracing = null;
                if (context != null) {
                    tracing = context.getModuleMetaData(DeploymentTracing.class);
                }
                if (tracing!=null) {
                    tracing.addMark(DeploymentTracing.Mark.DOL_LOADED);
                }
                ApplicationHolder holder = new ApplicationHolder(application);
                if (context != null) {
                    context.addModuleMetaData(holder);
                }
View Full Code Here

TOP

Related Classes of org.glassfish.internal.deployment.DeploymentTracing

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.