Package com.sun.appserv.management.deploy

Examples of com.sun.appserv.management.deploy.DeploymentProgressImpl


        try {
            DeploymentCallback callback = req.getDeploymentCallback();
            if (callback != null) {
                int percent = 0;
                DeploymentProgress progress = new DeploymentProgressImpl(
                    (byte)percent, "deployment started", null);
                callback.deploymentProgress(progress);
            }
       
            // set the current deployment status in deployment request
            // to J2EECPhase deployment status
            req.setCurrentDeploymentStatus(status);

            req.setDescriptor(deploymentCtx.getApplication(req.getName()));

            if (DeploymentServiceUtils.isRegistered(req.getName(),
                req.getType()) && req.isForced()) {

                isRedeploy = true;

                //Re-record instrospect/instrument/verifier data if
                //any of the application is re-deployed
                if (AppVerification.doInstrument()) {
                    AppVerification.getInstrumentLogger().handleChangeInDeployment();
                }
            }

            if(req.isApplication())
                isApp = true;
           
            if (!req.isExtensionModule()) {
                deployer = DeployerFactory.getDeployer(req);
                deployer.doRequestPrepare();
            }

            if(isRedeploy) {
                // clear the deploymentCtx cache now
                deploymentCtx.removeApplication(req.getName());              
                req.setDescriptor(null);

                target = (DeploymentTarget)req.getTarget();
               
                // In the case of redeploy to domain,
                // no stop event will be sent.
                if(target != null && ! target.getName().equals("domain")) {
                    targetName = target.getName();
               
                    if(isApp) {
                        type = null;
                        actionCode  = BaseDeployEvent.APPLICATION_UNDEPLOYED;
                    }
                    else {
                        type = DeploymentServiceUtils.getModuleTypeString(req.getType());
                        actionCode  = BaseDeployEvent.MODULE_UNDEPLOYED;
                    }
                    DeploymentServiceUtils.multicastEvent(actionCode, req.getName(), type, req.getCascade(), req.isForced(),  targetName);
                    wasUnRegistered = true;
                }
            }
           
            if (req.isExtensionModule()) {
                ModuleType moduleType = req.getType().getModuleType();
                extDeployer =
                    PluggableDeploymentInfo.getExtensionModuleDeployer(
                        moduleType);  
                if (isRedeploy) {
                    extDeployer.redeployToDomain(req);
                } else {
                    extDeployer.deployToDomain(req);
                }
            } else {
                deployer.doRequestFinish();
                // cache the updated application object in deployment context
                deploymentCtx.addApplication(req.getName(), req.getDescriptor());
                parseAndValidateSunResourcesXMLFiles(req);
                deployer.cleanup();
            }
           
            // check if an abort operation has been issued
            // throw exception if true
            DeploymentServiceUtils.checkAbort(req.getName());

            // do all the config update at the end for easy rollback
            if(isRedeploy) {
                DeploymentServiceUtils.updateConfig(req);
            } else {
                DeploymentServiceUtils.addToConfig(req);
            }
            // set context roots on config bean
            ApplicationConfigHelper.resetAppContextRoots(
                DeploymentServiceUtils.getConfigContext(), req.getName(),
                true);

            wasUnRegistered = false// addToConfig re-registered it...

            // everything went fine
            status.setStageStatus(DeploymentStatus.SUCCESS);           
           
            // some useful information for clients...
            sLogger.log(Level.INFO, "deployed with " + DeploymentProperties.MODULE_ID + " = " + req.getName());
            populateStatusProperties(status, req);
            if (callback != null) {
                int percent = 100;
                DeploymentProgress progress2 = new DeploymentProgressImpl(
                    (byte)percent, "deployment finished", null);
                callback.deploymentProgress(progress2);
            }
        
        } catch(Throwable t) {
View Full Code Here


    public DeploymentProgressImpl
  createDeploymentProgress()
  {
    final Object  id  = "deploy:999";
   
    final DeploymentProgressImpl  dp  =
      new DeploymentProgressImpl( (byte)99, "description", null );
   
    return( dp );
  }
View Full Code Here

 
 
    public void
  testDeploymentProgressAsMap()
  {
    final DeploymentProgressImpl  dp  = createDeploymentProgress();
   
    final Map<String,Serializable>  data  = dp.asMap();
  }
View Full Code Here

  }
 
    public void
  testDeploymentProgressFromMap()
  {
    final DeploymentProgressImpl  dp  = createDeploymentProgress();
   
    final Map<String,Serializable>  data = dp.asMap();
   
    final DeploymentProgressImpl dp2  = new DeploymentProgressImpl( data );
   
    assert( dp2.equals( dp ) );
  }
View Full Code Here

    while ( percent < 100 )
    {
      percent  += 10;
     
      final DeploymentProgress  progress  =
        new DeploymentProgressImpl(
          (byte)percent, "percent done", null);
       
      callback.deploymentProgress( progress );
      Thread.sleep( 1 );
    }
View Full Code Here

  getDeploymentProgress()
  {
    final byte    progressPercent      = 0;
    final String  description        = "<no description>";
   
    final DeploymentProgressImpl  progress  =
      new DeploymentProgressImpl( progressPercent, description, null);
   
    return( progress );
  }
View Full Code Here

TOP

Related Classes of com.sun.appserv.management.deploy.DeploymentProgressImpl

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.