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

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


            OperationResult result = new OperationResult();
            result.setErrorMessage("Did not find deployment with key [" + deploymentKey + "]");
            return result;
        }

        DeploymentManager deploymentManager = connection.getDeploymentManager();
        DeploymentProgress progress;
        if (name.equals("start")) {
            //FIXME: This is a workaround until JOPR-309 will be fixed.
            if (getAvailability() != AvailabilityType.UP) {
                progress = deploymentManager.start(deploymentName);
            } else {
                LOG.warn("Operation '" + name + "' on " + getResourceDescription()
                    + " failed because the Resource is already started.");
                OperationResult result = new OperationResult();
                result.setErrorMessage(deploymentFile.getName() + " is already started.");
                return result;
            }
        } else if (name.equals("stop")) {
            progress = deploymentManager.stop(deploymentName);
        } else if (name.equals("restart")) {
            progress = deploymentManager.stop(deploymentName);
            DeploymentUtils.run(progress);
            // Still try to start, even if stop fails (maybe the app wasn't running to begin with).
            progress = deploymentManager.start(deploymentName);
        } else {
            throw new UnsupportedOperationException(name);
        }
        DeploymentStatus status = DeploymentUtils.run(progress);
        if (LOG.isDebugEnabled()) {
View Full Code Here


   *            whether to deploy exploded or not
   * @throws Exception
   */
  public static void deployFileToAS(String name, File archiveFile,
      boolean exploded) throws Exception {
    DeploymentManager deploymentManager = getDeploymentManager();

    DeploymentProgress progress = deploymentManager.distribute(name,
        archiveFile.toURI().toURL(), exploded);
    progress.run();

    DeploymentStatus status = progress.getDeploymentStatus();

    if (status.isFailed()) {
      throw new IllegalStateException("Failed to distribute "
          + archiveFile.getAbsolutePath() + " with message: "
          + status.getMessage());
    }

    String[] deploymentNames = progress.getDeploymentID()
        .getRepositoryNames();

    progress = deploymentManager.start(deploymentNames);
    progress.run();

    status = progress.getDeploymentStatus();

    if (status.isFailed()) {
View Full Code Here

   *
   * @param archiveName
   * @throws Exception
   */
  public static void undeployFromAS(String archiveName) throws Exception {
    DeploymentManager deploymentManager = getDeploymentManager();

    DeploymentProgress progress = deploymentManager.remove(archiveName);
    progress.run();

    DeploymentStatus status = progress.getDeploymentStatus();

    if (status.isFailed()) {
View Full Code Here

   }

   DeploymentProgress distributeAndStart(String deploymentName, boolean copyContent, boolean checkStopped) throws Exception
   {
      // The deployment manager
      DeploymentManager deployMgr = getDeploymentManager();

      // Distribute
      DeploymentProgress distribute = deployMgr.distribute(deploymentName,
            getDeployURL(deploymentName), copyContent);
      distribute.run();
      // Distribute always has to complete
      assertComplete(distribute);
      // check if the app is stopped
      if(checkStopped)
         assertDeploymentState(distribute.getDeploymentID(), DeploymentState.STOPPED);

      // Get the repository names
      String[] uploadedNames = distribute.getDeploymentID().getRepositoryNames();
      assertNotNull(uploadedNames);

      // Start
      DeploymentProgress start = deployMgr.start(uploadedNames);
      start.run();
      // Return the start deployment progress
      return start;
   }
View Full Code Here

   }

   void redeployCheckComplete(String name) throws Exception
   {
      // The deployment manager
      DeploymentManager deployMgr = getDeploymentManager();

      // Redeploy
      DeploymentProgress redeploy = deployMgr.redeploy(name);
      redeploy.run();
      assertComplete(redeploy);
      assertDeploymentState(redeploy.getDeploymentID(), DeploymentState.STARTED);
   }
View Full Code Here

   }

   void prepareCheckComplete(String name) throws Exception
   {
      // The deployment manager
      DeploymentManager deployMgr = getDeploymentManager();

      // Prepare
      DeploymentProgress prepare = deployMgr.prepare(name);
      prepare.run();
      assertComplete(prepare);
   }
View Full Code Here

   }

   void stopAndRemove(String[] names) throws Exception
   {
      // The deployment manager
      DeploymentManager deployMgr = getDeploymentManager();

      try
      {
         DeploymentProgress stop = deployMgr.stop(names);
         stop.run();
         assertComplete(stop);
         assertDeploymentState(stop.getDeploymentID(), DeploymentState.STOPPED);
      }
      catch(Exception e)
      {
         log.debug("stopAndRemove Failed ", e);
         throw e;
      }
      finally
      {
         DeploymentProgress remove = deployMgr.remove(names);
         remove.run();
         assertComplete(remove);

         String name = remove.getDeploymentID().getNames()[0];
         ManagementView mgtView = getManagementView();
View Full Code Here

      return ds;
   }
  
   protected String[] deployPackage(String name) throws Exception
   {
      DeploymentManager deployMgr = getDeploymentManager();
      URL contentURL = getDeployURL(name);

      assertNotNull(contentURL);
     
      String[] uploadedNames = {};
View Full Code Here

   }
  
  
   protected void undeployPackage(String[] repositoryNames) throws Exception
   {
      DeploymentManager deployMgr = getDeploymentManager();
      try
      {
         stop(deployMgr, repositoryNames);
      }
      finally
View Full Code Here

   @Override
   protected void setUp() throws Exception
   {
      super.setUp();
      DeploymentManager deployMgr = getDeploymentManager();
      deployMgr.loadProfile(getProfileKey());
   }
View Full Code Here

TOP

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

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.