Package com.sun.enterprise.deployment.backend

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


        String type = null;
       
        DeploymentRequest req = phaseCtx.getDeploymentRequest();

        DeploymentTarget target = (DeploymentTarget)req.getTarget();
        DeploymentStatus status = phaseCtx.getDeploymentStatus();

        if (!DeploymentServiceUtils.containsResourceAdapter(req)) {
            status.setStageStatus(DeploymentStatus.SUCCESS);
            return;
        }

        if(!req.isApplication())
        {        
            type = DeploymentServiceUtils.getModuleTypeString(req.getType());
        }
       
        try {
            if (req.getCascade() && !req.isForced()){
                deleteConnectorDependentResources(req.getName(),
                    target.getName());
                deploymentCtx.getConfigContext().flush();
                AdminContext adminContext =
                        AdminService.getAdminService().getAdminContext();
                new AdminNotificationHelper(adminContext).sendNotification();
            }
        } catch(Throwable t){
            status.setStageStatus(DeploymentStatus.WARNING);
            status.setStageException(t);
            status.setStageStatusMessage(t.getMessage());
            return;
        }

        prePhaseNotify(getPrePhaseEvent(req));
       
        boolean success;
        try {
            success = target.sendStopEvent(req.getActionCode(), req.getName(), type, req.getCascade(), req.isForced(), Constants.UNLOAD_RAR);
        } catch(DeploymentTargetException dte) {
            status.setStageStatus(DeploymentStatus.WARNING);
            if (dte.getCause()!=null) {
                status.setStageException(dte.getCause());
                status.setStageStatusMessage(dte.getMessage());
            }
            return;
        }
        if (success) {
            status.setStageStatus(DeploymentStatus.SUCCESS);
        } else {
            status.setStageStatus(DeploymentStatus.WARNING);
            status.setStageStatusMessage("Application failed to stop");
        }           
       
        postPhaseNotify(getPostPhaseEvent(req));
       
        // if any exception is thrown. we let the stack unroll, it
View Full Code Here


        AbstractArchive archive = (new ArchiveFactory()).openArchive(archivePath);
        DeploymentFacility df= DeploymentFacilityFactory.getLocalDeploymentFacility();
        JESProgressObject progressObject = null;
       
        progressObject = df.deploy(df.createTargets(targets), archive, null , props)//null for deployment plan
        DeploymentStatus status = null;
        do {
            status = progressObject.getCompletedStatus();
            if(status == null) {
                try {
                    Thread.currentThread().sleep(1000);
View Full Code Here

                    targetNames = refList.toArray(new String[refList.size()]);
                else
                    targetNames=new String[]{"domain"};
            }
            progressObject = df.undeploy(df.createTargets(targetNames), appName, dProps);
            DeploymentStatus status = df.waitFor(progressObject);
            //we DO want it to continue and call the rest handlers, ie navigate(). This will
            //re-generate the table data because there may be some apps thats been undeployed
            //successfully.  If we stopProcessing, the table data is stale and still shows the
            //app that has been gone.
            if( checkDeployStatus(status, handlerCtx, false)){
View Full Code Here

           
            if (addFlag)
                progressObject = df.createAppRef(df.createTargets(targetNames), appName, dProps);
            else
                progressObject = df.deleteAppRef(df.createTargets(targetNames), appName, dProps);
            DeploymentStatus status = df.waitFor(progressObject);
            checkDeployStatus(status, handlerCtx, true);
        }
    }
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.FAILURE) {
            throw new CommandException(getLocalizedString(
                "CommandUnSuccessfulWithMsg", new Object[] {name,
                statusString} ));
        } else if (status != null &&
            status.getStatus() == DeploymentStatus.WARNING) {
            CLILogger.getInstance().printDetailMessage(getLocalizedString(
                "CommandSuccessfulWithMsg",
                new Object[] {name, statusString}));
        } else {
            CLILogger.getInstance().printDetailMessage(getLocalizedString(
View Full Code Here

        throws CommandException, CommandValidationException
    {  
        System.setProperty(DefaultConfiguration.REDIRECTION, "false");
        validateOptions();
        JESProgressObject progressObject = callDeploy();
        DeploymentStatus status = df.waitFor(progressObject);
        String statusString = status.getStageStatusMessage();

        if (statusString.indexOf("302")>-1) {
            setOption(SECURE, "true");
            progressObject = this.callDeploy();
            status = df.waitFor(progressObject);
            statusString = status.getStageStatusMessage();
        }

        if (status != null && status.getStatus() == DeploymentStatus.FAILURE) {
            checkDeployStatus(status, statusString);
        }

        final String retrievePath = getOption(RETRIEVE_DIR);
        if (retrievePath != null){
            try {
                CLILogger.getInstance().printDebugMessage("componentName = " + componentName +
                                                  " retrievePath = " + retrievePath);
                final String fileName = df.downloadFile(new File(retrievePath), componentName, null);
                CLILogger.getInstance().printDebugMessage("downloaded stubs to  : " + fileName );
      }
      catch(Exception e){
          throw new CommandException((getLocalizedString(
                    "InvalidValueInOption", new Object[] {RETRIEVE_DIR,
                    retrievePath})) + "\n"+ e.getLocalizedMessage());
      }
  }

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

                AbstractArchive plan = null;
                Target[] targets = deployer.createTargets(new String[]{target});
                logger.log(Level.FINE, methodSig + " calling backend deploy");
                JESProgressObject progressObject =
                        deployer.deploy(targets, arch, plan, deployOptions);
                DeploymentStatus status = deployer.waitFor(progressObject);
                logger.log(Level.FINE,
                        methodSig + " deployment complete. status = " + status.getStatus());
                if (status.getStatus() != DeploymentStatus.SUCCESS) {
                    deploymentSuccessful = false;
                    deploymentError = methodSig + status.toString();
                    deploymentException = status.getStageException();
                }
            } else {
                dummyCompApps.add(serviceUnitName);
            }
        } catch (Exception ex) {
View Full Code Here

            //TODO: clear registries (wsdlCache)
            if(!dummyCompApps.remove(serviceUnitName)) {
                Target[] targets = deployer.createTargets(new String[]{target});
                JESProgressObject progressObject =
                        deployer.undeploy(targets, serviceUnitName, getUnDeploymentOptions());
                DeploymentStatus status = deployer.waitFor(progressObject);
                if (status.getStatus() != DeploymentStatus.SUCCESS) {
                    undeploymentSuccessful = false;
                    undeploymentError = methodSig + status.toString();
                    undeploymentException = status.getStageException();
                }
            }
           
        } catch (Exception ex) {
            undeploymentSuccessful = false;
View Full Code Here

        try {
            if(!dummyCompApps.contains(serviceUnitName)) {
                Target[] targets = deployer.createTargets(new String[]{target});
                JESProgressObject progressObject =
                        deployer.enable(targets, serviceUnitName);
                DeploymentStatus status = deployer.waitFor(progressObject);
                if (status.getStatus() != DeploymentStatus.SUCCESS) {
                    startSuccessful = false;
                    startError = methodSig + status.toString();
                    startException = status.getStageException();
                }
            }
           
        } catch (Exception ex) {
            startSuccessful = false;
View Full Code Here

        try {
            if(!dummyCompApps.contains(serviceUnitName)) {
                Target[] targets = deployer.createTargets(new String[]{target});
                JESProgressObject progressObject =
                        deployer.disable(targets, serviceUnitName);
                DeploymentStatus status = deployer.waitFor(progressObject);
                if (status.getStatus() != DeploymentStatus.SUCCESS) {
                    stopSuccessful = false;
                    stopError = methodSig + status.toString();
                    stopException = status.getStageException();
                }
            }
           
        } catch (Exception ex) {
            stopSuccessful = false;
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.