Package org.jboss.deployers.spi.management.deploy

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


  
   private void undeploy(String name) throws DeploymentException
   {
      try
      {
         DeploymentProgress stopProgress = deploymentManager.stop(name);
         stopProgress.run();

         DeploymentProgress undeployProgress = deploymentManager.remove(name);
         undeployProgress.run();
         if (undeployProgress.getDeploymentStatus().isFailed())
         {
            failedUndeployments.add(name);
         }
      }
      catch (Exception e)
View Full Code Here


   private void deploy(String deploymentName, URL url) throws DeploymentException
   {
      Exception failure = null;
      try
      {
         DeploymentProgress distribute = deploymentManager.distribute(deploymentName, url, true);
         distribute.run();
         DeploymentStatus uploadStatus = distribute.getDeploymentStatus();
         if(uploadStatus.isFailed())
         {
            failure = uploadStatus.getFailure();
            undeploy(deploymentName);
         }
         else
         {
            DeploymentProgress progress = deploymentManager.start(deploymentName);
            progress.run();
            DeploymentStatus status = progress.getDeploymentStatus();
            if (status.isFailed())
            {
               failure = status.getFailure();
               undeploy(deploymentName);
            }
View Full Code Here

  
   private void undeploy(String name) throws DeploymentException
   {
      try
      {
         DeploymentProgress stopProgress = deploymentManager.stop(name);
         stopProgress.run();

         DeploymentProgress undeployProgress = deploymentManager.remove(name);
         undeployProgress.run();
         if (undeployProgress.getDeploymentStatus().isFailed())
         {
            failedUndeployments.add(name);
         }
      }
      catch (Exception e)
View Full Code Here

      List<String> remainingDeployments = new ArrayList<String>();
      for (String name : failedUndeployments)
      {
         try
         {
            DeploymentProgress undeployProgress = deploymentManager.remove(name);
            undeployProgress.run();
            if (undeployProgress.getDeploymentStatus().isFailed())
            {
               remainingDeployments.add(name);
            }
         }
         catch (Exception e)
View Full Code Here

            }
         });
         URL fileServerUrl = createFileServerURL(deploymentName);
        
         DeploymentProgress distribute = deploymentManager.distribute(deploymentName, DeploymentPhase.APPLICATION, fileServerUrl, true);
         distribute.run();
         DeploymentStatus uploadStatus = distribute.getDeploymentStatus();
         if(uploadStatus.isFailed())
         {
            failure = uploadStatus.getFailure();
            undeploy(deploymentName);
         }
         else
         {
            DeploymentProgress progress = deploymentManager.start(DeploymentPhase.APPLICATION, deploymentName);
            progress.run();
            DeploymentStatus status = progress.getDeploymentStatus();
            if (status.isFailed())
            {
               failure = status.getFailure();
               undeploy(deploymentName);
            }
View Full Code Here

   private void undeploy(String name) throws DeploymentException
   {
      try
      {
         DeploymentProgress stopProgress = deploymentManager.stop(DeploymentPhase.APPLICATION, name);
         stopProgress.run();

         DeploymentProgress undeployProgress = deploymentManager.undeploy(DeploymentPhase.APPLICATION, name);
         undeployProgress.run();
         if (undeployProgress.getDeploymentStatus().isFailed())
         {
            failedUndeployments.add(name);
         }
         httpFileServer.removeContext("/" + name);
      }
View Full Code Here

      List<String> remainingDeployments = new ArrayList<String>();
      for (String name : failedUndeployments)
      {
         try
         {
            DeploymentProgress undeployProgress = deploymentManager.undeploy(DeploymentPhase.APPLICATION, name);
            undeployProgress.run();
            if (undeployProgress.getDeploymentStatus().isFailed())
            {
               remainingDeployments.add(name);
            }
         }
         catch (Exception e)
View Full Code Here

   {
      String names[] = new String[] {deployment};
      DeploymentManager deployMgr_ = getDeploymentManager();
      try
      {
         DeploymentProgress progress = deployMgr_.stop(names);
         progress.run();
         assertFalse("failed: " + progress.getDeploymentStatus().getFailure(), progress.getDeploymentStatus().isFailed());
      }
      finally
      {
         DeploymentProgress progress = deployMgr_.remove(names);
         progress.run();
         assertFalse("failed: " + progress.getDeploymentStatus().getFailure(), progress.getDeploymentStatus().isFailed());
      }
   }
View Full Code Here

    int p = urlString.indexOf(":/");
    contentURL = new URL("vfszip" + 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

   private void deploy(String deploymentName, URL url) throws DeploymentException
   {
      Exception failure = null;
      try
      {
         DeploymentProgress distribute = deploymentManager.distribute(deploymentName, url, true);
         distribute.run();
         DeploymentStatus uploadStatus = distribute.getDeploymentStatus();
         if(uploadStatus.isFailed())
         {
            failure = uploadStatus.getFailure();
            undeploy(deploymentName);
         }
         else
         {
            DeploymentProgress progress = deploymentManager.start(deploymentName);
            progress.run();
            DeploymentStatus status = progress.getDeploymentStatus();
            if (status.isFailed())
            {
               failure = status.getFailure();
               undeploy(deploymentName);
            }
View Full Code Here

TOP

Related Classes of org.jboss.deployers.spi.management.deploy.DeploymentProgress

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.