Examples of DeploymentProgress


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

        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

Examples of org.jboss.deployers.spi.management.deploy.DeploymentProgress

    List<DeploymentOption> deploymentOptions = new ArrayList<DeploymentOption>();
    if (deployExploded) {
      deploymentOptions.add(DeploymentOption.Explode);
    }
    // try to deploy
    DeploymentProgress progress = null;
    try {
      progress = deploymentManager.distribute(fileName, resourceURL, deploymentOptions.toArray(new DeploymentOption[deploymentOptions.size()]));
      execute(progress, IntegrationPlugin.Util.getString("distribute_failed", fileName)); //$NON-NLS-1$
    } catch (Exception e) {
      handleException(e);
    }
   
    // Now that we've successfully distributed the deployment, we need to
    // start it.
    String[] deploymentNames = progress.getDeploymentID().getRepositoryNames();
    try {
      progress = deploymentManager.start(deploymentNames);
      execute(progress, IntegrationPlugin.Util.getString("deployment_start_failed", fileName)); //$NON-NLS-1$
    } catch(Exception e) {
      try {
View Full Code Here

Examples of org.jboss.deployers.spi.management.deploy.DeploymentProgress

    DeploymentManager deploymentManager = getConnection()
        .getDeploymentManager();
   
    log.debug("Stopping deployment [" + this.deploymentUrl + "]..."); //$NON-NLS-1$ //$NON-NLS-2$
    DeploymentProgress progress = deploymentManager
        .stop(this.deploymentUrl);
    DeploymentStatus stopStatus = DeploymentUtils.run(progress);
    if (stopStatus.isFailed()) {
      log.error("Failed to stop deployment '" + this.deploymentUrl //$NON-NLS-1$
          + "'.", stopStatus.getFailure()); //$NON-NLS-1$
View Full Code Here

Examples of org.jboss.deployers.spi.management.deploy.DeploymentProgress

    // Now stop the original app.
    try {
      DeploymentManager deploymentManager = getConnection()
          .getDeploymentManager();
      DeploymentProgress progress = deploymentManager
          .stop(this.deploymentUrl);
      DeploymentUtils.run(progress);
    } catch (Exception e) {
      throw new RuntimeException("Failed to stop deployment [" //$NON-NLS-1$
          + this.deploymentUrl + "].", e); //$NON-NLS-1$
    }

    // And then remove it (this will delete the physical file/dir from the
    // deploy dir).
    try {
      DeploymentManager deploymentManager = getConnection()
          .getDeploymentManager();
      DeploymentProgress progress = deploymentManager
          .remove(this.deploymentUrl);
      DeploymentUtils.run(progress);
    } catch (Exception e) {
      throw new RuntimeException("Failed to remove deployment [" //$NON-NLS-1$
          + this.deploymentUrl + "].", e); //$NON-NLS-1$
View Full Code Here

Examples of org.jboss.deployers.spi.management.deploy.DeploymentProgress

   * @param archiveFileName
   * @throws Exception
   */
  private static void deployAndStart(DeploymentManager deploymentManager,
      URL contentURL, String archiveFileName) throws Exception {
    DeploymentProgress progress = null;
        DeploymentStatus distributeStatus;
        Exception distributeFailure = null;
        try {
            progress = deploymentManager.distribute(archiveFileName, contentURL, true);
            distributeStatus = run(progress);
            if (distributeStatus.isFailed()) {
                distributeFailure = (distributeStatus.getFailure() != null) ? distributeStatus.getFailure() :
                        new Exception("Distribute failed for unknown reason."); //$NON-NLS-1$
            }
        }
        catch (Exception e) {
            distributeFailure = e;
        }
        if (distributeFailure != null) {
            throw new Exception("Failed to distribute '" + contentURL + "' to '" + archiveFileName + "' - cause: "  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                    + ThrowableUtil.getAllMessages(distributeFailure));
        }

        // Now that we've successfully distributed the deployment, we need to start it.
        String[] deploymentNames = progress.getDeploymentID().getRepositoryNames();
        DeploymentStatus startStatus;
        Exception startFailure = null;
        try {
            progress = deploymentManager.start(deploymentNames);
            startStatus = run(progress);
View Full Code Here

Examples of org.jboss.deployers.spi.management.deploy.DeploymentProgress

   @Override
   protected void tearDown() throws Exception
   {
      // Undeploy the test JAR
      log.info("Undeploying: " + repositoryNames);
      final DeploymentProgress stopProgress = deploymentManager.stop(repositoryNames);
      stopProgress.run();
      final DeploymentProgress removeProgress = deploymentManager.remove(repositoryNames);
      removeProgress.run();

      // Null out
      repositoryNames = null;
      deploymentManager = null;
      managementView = null;
View Full Code Here

Examples of org.jboss.deployers.spi.management.deploy.DeploymentProgress

    * @throws Exception
    */
   protected void deploy(final String deployName, final URL url) throws Exception
   {
      // Deploy
      final DeploymentProgress distributeProgress = deploymentManager.distribute(deployName, url, true);
      distributeProgress.run();
      repositoryNames = distributeProgress.getDeploymentID().getRepositoryNames();
      final DeploymentProgress startProgress = deploymentManager.start(repositoryNames);
      log.info("Deploying: " + repositoryNames);
      startProgress.run();

      // Reset the Management View
      managementView = this.getManagementView();
   }
View Full Code Here

Examples of org.jboss.deployers.spi.management.deploy.DeploymentProgress

      int p = urlString.indexOf(":/");
      contentURL = new URL("file" + urlString.substring(p));
      getLog().debug(contentURL);

      DeploymentStatus status;
      DeploymentProgress progress = deployMgr.distribute(name, contentURL, true);
      progress.addProgressListener(this);
      progress.run();
      String[] uploadedNames = {};
      try
      {
         status = progress.getDeploymentStatus();
         assertTrue("DeploymentStatus.isCompleted: " + status, status.isCompleted());
         // It should not be running yet
         assertFalse("DeploymentStatus.isRunning: " + status, status.isRunning());
         assertFalse("DeploymentStatus.isFailed: " + status, status.isFailed());

         // Get the unique deployment name
         uploadedNames = progress.getDeploymentID().getRepositoryNames();
         getLog().debug("Uploaded deployment names: "+Arrays.asList(uploadedNames));
         // Now start the deployment
         progress = deployMgr.start(uploadedNames);
         progress.addProgressListener(this);
         progress.run();
         try
         {
            status = progress.getDeploymentStatus();
            assertTrue("DeploymentStatus.isCompleted: " + status, status.isCompleted());
            assertFalse("DeploymentStatus.isRunning: " + status, status.isRunning());
            assertFalse("DeploymentStatus.isFailed: " + status, status.isFailed());
            // Check for a
            ManagementView mgtView = getManagementView();
            ManagedDeployment deployment = mgtView.getDeployment(uploadedNames[0]);
            assertNotNull(deployment);
            getLog().info("Found " + type + " deployment: " + deployment);
            Set<String> types = deployment.getTypes();
            if (types != null && types.isEmpty() == false)
               assertTrue("Missing type: " + type + ", available: " + types, types.contains(type));
            if (tester != null)
            {
               tester.testManagedDeployment();
            }
         }
         finally
         {
            //Thread.sleep(15 * 1000); // 15 secs >> more than it takes for reaper to run :-)

            // Stop/remove the deployment
            progress = deployMgr.stop(uploadedNames);
            progress.addProgressListener(this);
            progress.run();
            status = progress.getDeploymentStatus();
            assertTrue("DeploymentStatus.isCompleted: " + status, status.isCompleted());
            assertFalse("DeploymentStatus.isFailed: " + status, status.isFailed());
         }
      }
      finally
      {
         progress = deployMgr.remove(uploadedNames);
         progress.addProgressListener(this);
         progress.run();
         status = progress.getDeploymentStatus();
         assertTrue("DeploymentStatus.isCompleted: " + status, status.isCompleted());
         assertFalse("DeploymentStatus.isFailed: " + status, status.isFailed());
      }
   }
View Full Code Here

Examples of org.jboss.deployers.spi.management.deploy.DeploymentProgress

      assertNotNull(test2)
      // Remove
      mgtView.removeComponent(remove);
     
      // Redeploy
      DeploymentProgress progress = getDeploymentManager().redeploy(test1.getDeployment().getName());
      progress.run();
     
      mgtView = getManagementView();
      remove = mgtView.getComponent("ProfileServiceTestRemoveDataSource", locaDSType);
      assertNull(remove);     
   }
View Full Code Here

Examples of org.jboss.deployers.spi.management.deploy.DeploymentProgress

                  return;

               String[] names = jarNames.split(",");
               for (String name : names)
               {
                  DeploymentProgress distribute = getDeploymentManager().distribute(name, getManagedURL(name), copyContent);
                  //distribute.addProgressListener(LOG_PROGRESS_LISTENER);
                  distribute.run();
                  checkProgress(distribute);

                  deploymentNames.addAll(Arrays.asList(distribute.getDeploymentID().getRepositoryNames()));
               }
              
               // Check the resolution of repository names
               assertTrue("resolve repsoitory names",
                     Arrays.asList(getDeploymentManager().getRepositoryNames(names)).containsAll(deploymentNames));
              
              
               DeploymentProgress start = getDeploymentManager().start(deploymentNames.toArray(new String[ deploymentNames.size()]));
               start.run();
               if(checkStarted)
                  checkProgress(start);

               staticLog.info("Deployed package: " + deploymentNames);
            }
            catch (Exception ex)
            {
               // Throw this in testServerFound() instead.
               deploymentException = ex;
               staticLog.error("Caught exception when trying to deploy : " + jarNames, ex);
            }
         }

         protected void tearDown() throws Exception
         {
            if (jarNames == null)
               return;

            DeploymentProgress stop = getDeploymentManager().stop(deploymentNames.toArray(new String[ deploymentNames.size()]));
            stop.run();
            checkProgress(stop);

            DeploymentProgress undeploy = getDeploymentManager().remove(deploymentNames.toArray(new String[ deploymentNames.size()]));
            undeploy.run();
            checkProgress(undeploy);

            this.mv.load();
            for(String deploymentName : deploymentNames)
            {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.