Package org.glassfish.internal.data

Examples of org.glassfish.internal.data.ApplicationInfo


                            parameters.name = appName;
                        }
                    }
                    ExtendedDeploymentContext depContext = deployment.getBuilder(logger, parameters, report).source(sourceArchive).build();
                   
                    ApplicationInfo appInfo = deployment.deploy(depContext);
                    if (appInfo==null) {

                        logger.log(Level.SEVERE, KernelLoggerInfo.cantFindApplicationInfo, sourceFile.getAbsolutePath());
                    }
                } catch(RuntimeException e) {
View Full Code Here


        // which are registered in the domain.xml
        List<Application> allApplications = new ArrayList<Application>();
        allApplications.addAll(applications.getApplications());
        allApplications.addAll(systemApplications.getApplications());
        for (Application app : allApplications) {
            ApplicationInfo appInfo = deployment.get(app.getName());
            stopApplication(app, appInfo);
        }

        // now stop the applications which are not registered in the
        // domain.xml like timer service application
        Set<String> allAppNames = new HashSet<String>();
        allAppNames.addAll(appRegistry.getAllApplicationNames());
        for (String appName : allAppNames) {
            ApplicationInfo appInfo = appRegistry.get(appName);
            stopApplication(null, appInfo);
        }

        // stop all the containers
        for (EngineInfo engineInfo : containerRegistry.getContainers()) {
View Full Code Here

        for (AppTenant tenant : app.getAppTenants().getAppTenant()) {
            UndeployCommandParameters parameters = new UndeployCommandParameters();
            parameters.name = DeploymentUtils.getInternalNameForTenant(app.getName(), tenant.getTenant());
            parameters.origin = UndeployCommandParameters.Origin.unload;
            parameters.target = server.getName();
            ApplicationInfo appInfo = deployment.get(parameters.name);
            if (appInfo == null) {
                continue;
            }

            ActionReport subReport = report.addSubActionsReport();

            try {
                ExtendedDeploymentContext deploymentContext = deployment.getBuilder(logger, parameters, subReport).source(appInfo.getSource()).build();

                deploymentContext.getAppProps().putAll(
                    app.getDeployProperties());
                deploymentContext.getAppProps().putAll(
                    tenant.getDeployProperties());
                deploymentContext.setModulePropsMap(
                    app.getModulePropertiesMap());

                deploymentContext.setTenant(tenant.getTenant(), app.getName());

                deployment.unload(appInfo, deploymentContext);

            } catch(Throwable e) {
               subReport.setActionExitCode(ActionReport.ExitCode.FAILURE);
               subReport.setMessage(e.getMessage());
               subReport.setFailureCause(e);
            }
            appRegistry.remove(appInfo.getName());
        }
    }
View Full Code Here

        if (event.is(Deployment.APPLICATION_PREPARED) && isDas()) {
            ExtendedDeploymentContext context = (ExtendedDeploymentContext)event.hook();
            OpsParams opsparams = context.getCommandParameters(OpsParams.class);
            DeployCommandParameters dcp = context.getCommandParameters(DeployCommandParameters.class);

            ApplicationInfo appInfo = appRegistry.get(opsparams.name());
            Application app = appInfo.getMetaData(Application.class);
            if (app == null) {
                // Not a Java EE application
                return;
            }

            if (_logger.isLoggable(Level.FINE)) {
                _logger.log( Level.FINE, "EjbDeployer in APPLICATION_PREPARED for origin: " + opsparams.origin +
                        ", target: " + dcp.target + ", name: " + opsparams.name());
            }

            boolean createTimers = true;
            if (!(opsparams.origin.isDeploy() || opsparams.origin.isCreateAppRef()) || env.getInstanceName().equals(dcp.target)) {
                // Do real work only on deploy for a cluster or create-application-ref (the latter will
                // check if it's the 1st ref being added or a subsequent one (timers with this unique id are present
                // or not)
                // Timers will be created by the BaseContainer if it's a single instance deploy
                if (_logger.isLoggable(Level.FINE)) {
                    _logger.log( Level.FINE, "EjbDeployer ... will only set the timeout application flag if any");
                }
                // But is-timed-app needs to be set in AppInfo in any case
                createTimers = false;
            }

            String target = dcp.target;
            if (createTimers && dcp.isredeploy != null && dcp.isredeploy && DeploymentUtils.isDomainTarget(target)) {
                List<String> targets = (List<String>)context.getTransientAppMetaData(DeploymentProperties.PREVIOUS_TARGETS, List.class);
                for (String ref: targets) {
                    target = ref;
                    if (domain.getClusterNamed(target) != null) {
                        break; // prefer cluster target
                    }
                 }
            }

            if (_logger.isLoggable(Level.FINE)) {
                _logger.log( Level.FINE, "EjbDeployer using target for event as " + target);
            }

            boolean isTimedApp = false;
            for (EjbBundleDescriptorImpl ejbBundle : app.getBundleDescriptors(EjbBundleDescriptorImpl.class)) {
                if (checkEjbBundleForTimers(ejbBundle, createTimers, target)) {
                    isTimedApp = true;
                }
            }
   
            if (isTimedApp && (opsparams.origin.isDeploy() || opsparams.origin.isLoad())) {
                // Mark application as a timeout application, so that the clean() call removes the timers.
                appInfo.addTransientAppMetaData(IS_TIMEOUT_APP_PROP, Boolean.TRUE);
            }
        }
    }
View Full Code Here

    private boolean getKeepStateFromApplicationInfo(String appName) {
        return getBooleanStateFromApplicationInfo(EjbApplication.KEEP_STATE, appName);
    }

    private boolean getBooleanStateFromApplicationInfo(String flag, String appName) {
        ApplicationInfo appInfo = appRegistry.get(appName);
        if (appInfo == null) {
            // appInfo can be null when running EjbDeployer.clean after a failed deploy
            return false;
        }
        Boolean rc = appInfo.getTransientAppMetaData(flag, Boolean.class);
        return (rc == null ? false : rc);
    }
View Full Code Here

                            parameters.name = appName;
                        }
                    }
                    ExtendedDeploymentContext depContext = deployment.getBuilder(logger, parameters, report).source(sourceArchive).build();
                   
                    ApplicationInfo appInfo = deployment.deploy(depContext);
                    if (appInfo==null) {

                        logger.log(Level.SEVERE, KernelLoggerInfo.cantFindApplicationInfo, sourceFile.getAbsolutePath());
                    }
                } catch(RuntimeException e) {
View Full Code Here

        // which are registered in the domain.xml
        List<Application> allApplications = new ArrayList<Application>();
        allApplications.addAll(applications.getApplications());
        allApplications.addAll(systemApplications.getApplications());
        for (Application app : allApplications) {
            ApplicationInfo appInfo = deployment.get(app.getName());
            stopApplication(app, appInfo);
        }

        // now stop the applications which are not registered in the
        // domain.xml like timer service application
        Set<String> allAppNames = new HashSet<String>();
        allAppNames.addAll(appRegistry.getAllApplicationNames());
        for (String appName : allAppNames) {
            ApplicationInfo appInfo = appRegistry.get(appName);
            stopApplication(null, appInfo);
        }

        // stop all the containers
        for (EngineInfo engineInfo : containerRegistry.getContainers()) {
View Full Code Here

        for (AppTenant tenant : app.getAppTenants().getAppTenant()) {
            UndeployCommandParameters parameters = new UndeployCommandParameters();
            parameters.name = DeploymentUtils.getInternalNameForTenant(app.getName(), tenant.getTenant());
            parameters.origin = UndeployCommandParameters.Origin.unload;
            parameters.target = server.getName();
            ApplicationInfo appInfo = deployment.get(parameters.name);
            if (appInfo == null) {
                continue;
            }

            ActionReport subReport = report.addSubActionsReport();

            try {
                ExtendedDeploymentContext deploymentContext = deployment.getBuilder(logger, parameters, subReport).source(appInfo.getSource()).build();

                deploymentContext.getAppProps().putAll(
                    app.getDeployProperties());
                deploymentContext.getAppProps().putAll(
                    tenant.getDeployProperties());
                deploymentContext.setModulePropsMap(
                    app.getModulePropertiesMap());

                deploymentContext.setTenant(tenant.getTenant(), app.getName());

                deployment.unload(appInfo, deploymentContext);

            } catch(Throwable e) {
               subReport.setActionExitCode(ActionReport.ExitCode.FAILURE);
               subReport.setMessage(e.getMessage());
               subReport.setFailureCause(e);
            }
            appRegistry.remove(appInfo.getName());
        }
    }
View Full Code Here

                t = new Transaction();
            } else {
                t = deployment.prepareAppConfigChanges(deploymentContext);
            }

            ApplicationInfo appInfo;
            appInfo = deployment.deploy(deploymentContext);

            if (report.getActionExitCode()==ActionReport.ExitCode.SUCCESS) {
                try {
                    moveAltDDFilesToPermanentLocation(deploymentContext, logger);
View Full Code Here

            Transaction t = deployment.prepareAppConfigChanges(deploymentContext);
            if (tracing!=null) {
                tracing.addMark(DeploymentTracing.Mark.DEPLOY);
            }
            ApplicationInfo appInfo;
            appInfo = deployment.deploy(deploymentContext);

            /*
             * Various deployers might have added to the downloadable or
             * generated artifacts.  Extract them and, if the command succeeded,
View Full Code Here

TOP

Related Classes of org.glassfish.internal.data.ApplicationInfo

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.