Package com.sun.enterprise.deployment.backend

Examples of com.sun.enterprise.deployment.backend.DeploymentStatus


            sLogger.log(Level.FINE, "mbean.start", moduleID);
            return DeploymentService.getDeploymentService().start(moduleID,
                targetName, options);
        } catch (Exception e) {
            sLogger.log(Level.WARNING, "mbean.start_failed", e);
            DeploymentStatus ds = new DeploymentStatus();
            ds.setStageException(e);
            ds.setStageStatus(DeploymentStatus.FAILURE);
            ds.setStageStatusMessage(e.getMessage());
            ds.setStageDescription("Start");
            return ds;
        }
    }
View Full Code Here


        }
    }

    public Map startAndReturnStatusAsMap(
        String moduleID, String targetName, Map options) {
        DeploymentStatus oldStatus = start(moduleID, targetName, options);
        return oldStatus.asMap();
    }
View Full Code Here

    public DeploymentStatus stop(String moduleID, String targetName,
        Map options) {
        try {
            sLogger.log(Level.FINE, "mbean.stop", moduleID);
            DeploymentStatus status = DeploymentService.getDeploymentService().stop(moduleID,
                targetName, options);
            //deployment already added all required config changes to its events
            // so, we remove them to avoid extra deployment events
            getConfigContext().flush();
            getConfigContext().resetConfigChangeList();
            return status;
        } catch (Exception e) {
            sLogger.log(Level.WARNING, "mbean.stop_failed", e);
            DeploymentStatus ds = new DeploymentStatus();
            ds.setStageException(e);
            ds.setStageStatus(DeploymentStatus.FAILURE);
            ds.setStageStatusMessage(e.getMessage());
            ds.setStageDescription("Stop");
            return ds;
        }
    }
View Full Code Here

        }
    }

    public Map stopAndReturnStatusAsMap(
        String moduleID, String targetName, Map options) {
        DeploymentStatus oldStatus = stop(moduleID, targetName, options);
        return oldStatus.asMap();
    }
View Full Code Here

     * @param targetName the target
     * @param options
     * @return returns a DeploymentStatus
     */
    public DeploymentStatus createLifecycleModuleReference(String referenceName, String targetName, Map options) {
        DeploymentStatus ds = new DeploymentStatus();
        ds.setStageDescription("CreateLifecycleModuleReference");
        try {
            final DeploymentTarget target = getAndValidateDeploymentTarget(
                targetName, referenceName, false, false);
            boolean enabled = (new DeploymentProperties(options)).getEnable();
            target.addAppReference(referenceName, enabled, null);
            ds.setStageStatus(DeploymentStatus.SUCCESS);
        } catch(Exception e) {
            ds.setStageException(e);
            ds.setStageStatus(DeploymentStatus.FAILURE);
            ds.setStageStatusMessage(e.getMessage());
        }
        return ds;
    }
View Full Code Here

     * @param options
     * @return returns a DeploymentStatus
     * @throws Exception
     */
    public DeploymentStatus removeLifecycleModuleReference(String referenceName, String targetName) {
        DeploymentStatus ds = new DeploymentStatus();
        ds.setStageDescription("RemoveLifecycleModuleReference");
        try {
            final DeploymentTarget target = getAndValidateDeploymentTarget(
                targetName, referenceName, false, false);
            target.removeAppReference(referenceName);
            ds.setStageStatus(DeploymentStatus.SUCCESS);
        } catch(Exception e) {
            ds.setStageException(e);
            ds.setStageStatus(DeploymentStatus.FAILURE);
            ds.setStageStatusMessage(e.getMessage());
        }
        return ds;
    }
View Full Code Here

            throw new CommandException(getLocalizedString(
                "CommandUnSuccessful", new Object[] {name} ), e);
        }
       
        DeploymentStatus status = df.waitFor(progressObject);
        final String statusString = status.getStageStatusMessage();

        if (status != null &&
                status.getStatus() == DeploymentStatus.WARNING)
        {
            CLILogger.getInstance().printDetailMessage(getLocalizedString(
                "CommandSuccessfulWithMsg",
                new Object[] {name, statusString}));
        }
        else if (status != null &&
               status.getStatus() == DeploymentStatus.FAILURE)
        {
            throw new CommandException(getLocalizedString(
                "CommandUnSuccessfulWithMsg", new Object[] {name,
                statusString} ));
        }
View Full Code Here

            throw new CommandException(getLocalizedString(
                "CommandUnSuccessful", new Object[] {name} ), e);
        }

        DeploymentStatus status = df.waitFor(progressObject);
        final String statusString = status.getStageStatusMessage();

        if (status != null &&
                status.getStatus() == DeploymentStatus.WARNING)
        {
            CLILogger.getInstance().printDetailMessage(getLocalizedString(
                "CommandSuccessfulWithMsg",
                new Object[] {name, statusString}));
        }
        else if (status != null &&
               status.getStatus() == DeploymentStatus.FAILURE)
        {
            throw new CommandException(getLocalizedString(
                "CommandUnSuccessfulWithMsg", new Object[] {name,
                statusString} ));
        }
View Full Code Here

    private boolean undeployModule(ConnectionSource dasConnection, DeploymentStatus rollbackStatus) {
        DeploymentMgr deplMgr = ProxyFactory.getInstance(dasConnection).getDomainRoot().getDeploymentMgr();       
        Map undeployStatus = deplMgr.undeploy(moduleID, options);           
        com.sun.appserv.management.deploy.DeploymentStatus finalStatusFromMBean =
                            DeploymentSupport.mapToDeploymentStatus(undeployStatus);
        DeploymentStatus tmp = DeploymentClientUtils.getDeploymentStatusFromAdminStatus(finalStatusFromMBean);
        rollbackStatus.addSubStage(tmp);
        if (tmp!=null && tmp.getStatus() < DeploymentStatus.WARNING) {
            return false;
        }
        return true;
    }
View Full Code Here

        try {
            SunTarget[] targetObjs = (SunTarget[]) targetList.toArray(new SunTarget[targetList.size()]);
            for(int i=0; i<targetObjs.length; i++) {
                int state = ((Integer)targetState.get(targetObjs[i].getName())).intValue();
                if(state == APP_REF_CREATED) {
                    DeploymentStatus status =
                        DeploymentClientUtils.deleteApplicationReference(
                            dasConnection.getExistingMBeanServerConnection(),
                            moduleID, targetObjs[i], options);
                    rollbackStatus.addSubStage(status);
                    if (status!=null && status.getStatus() < DeploymentStatus.WARNING) {
                        return false;
                    }
                    targetState.remove(targetObjs[i].getName());
                }
            }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.backend.DeploymentStatus

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.