Package javax.enterprise.deploy.spi.status

Examples of javax.enterprise.deploy.spi.status.ProgressObject


         return new ProgressObjectImpl(status, targetModuleIDs);
      }

      // start the deployment process
      DeploymentStatus status = new DeploymentStatusImpl(StateType.RUNNING, CommandType.DISTRIBUTE, ActionType.EXECUTE, null);
      ProgressObject progress = new ProgressObjectImpl(status, targetModuleIDs);

      DeploymentWorker worker = new DeploymentWorker(progress);
      worker.start();

      return progress;
View Full Code Here


      log.debug("start " + Arrays.asList(targetModuleIDs));

      // start the deployment process
      DeploymentStatus status = new DeploymentStatusImpl(StateType.RUNNING, CommandType.START, ActionType.EXECUTE, null);
      ProgressObject progress = new ProgressObjectImpl(status, targetModuleIDs);

      DeploymentWorker worker = new DeploymentWorker(progress);
      worker.start();

      return progress;
View Full Code Here

         throw new IllegalStateException("DeploymentManager is not connected");

      log.debug("stop " + Arrays.asList(targetModuleIDs));

      DeploymentStatus status = new DeploymentStatusImpl(StateType.RUNNING, CommandType.STOP, ActionType.EXECUTE, null);
      ProgressObject progress = new ProgressObjectImpl(status, targetModuleIDs);

      DeploymentWorker worker = new DeploymentWorker(progress);
      worker.start();

      return progress;
View Full Code Here

      log.debug("undeploy " + Arrays.asList(targetModuleIDs));

      // start the deployment process
      DeploymentStatus status = new DeploymentStatusImpl(StateType.RUNNING, CommandType.UNDEPLOY, ActionType.EXECUTE, null);
      ProgressObject progress = new ProgressObjectImpl(status, targetModuleIDs);

      DeploymentWorker worker = new DeploymentWorker(progress);
      worker.start();

      return progress;
View Full Code Here

            planIs.close();
          }

          InputStream archiveIs = in.readInputStream();

          ProgressObject po = _deploymentService.distribute(targets, archiveIs, plan);

          // use up all of the input or hessian throws
          // an execption and hides  error reported in the progress object
          try {
            while (archiveIs.read() != -1) {}
          }
          catch (Exception t) {
            if (log.isLoggable(Level.FINEST))
              log.log(Level.FINEST, t.toString(), t);
          }

          in.completeCall();

          if (log.isLoggable(Level.FINEST))
            log.log(Level.FINEST, String.valueOf(po));

          out.startReply();
          out.writeObject(po);
          out.completeReply();
          break;
        }

      case UNDEPLOY:
        {
          TargetModuleID []targetIDs;
          targetIDs = (TargetModuleID []) in.readObject(TargetModuleID[].class);

          ProgressObject po = _deploymentService.undeploy(targetIDs);

          in.completeCall();
          out.startReply();
          out.writeObject(po);
          out.completeReply();
          break;
        }

        case START:
        {
          TargetModuleID []targetModuleIDs;
          targetModuleIDs = (TargetModuleID []) in.readObject(TargetModuleIDImpl[].class);

          ProgressObject po = _deploymentService.start(targetModuleIDs);

          in.completeCall();
          out.startReply();
          out.writeObject(po);
          out.completeReply();
          break;
        }

        case STOP:
        {
          TargetModuleID []targetModuleIDs;
          targetModuleIDs = (TargetModuleID []) in.readObject(TargetModuleIDImpl[].class);

          ProgressObject po = _deploymentService.stop(targetModuleIDs);

          in.completeCall();
          out.startReply();
          out.writeObject(po);
          out.completeReply();
View Full Code Here

            if (null == targets) {
                throw new IllegalStateException("No target to distribute to");
            }
            targets = new Target[] {targets[0]};

            ProgressObject po;
            if (DeployUtils.isJarFile(file) || file.isDirectory()) {
                po = mgr.distribute(targets, file, null);
            } else {
                po = mgr.distribute(targets, null, file);
            }
            waitForProgress(po);
            if (po.getDeploymentStatus().isCompleted()) {
                modules = po.getResultTargetModuleIDs();
                po = mgr.start(modules);
                waitForProgress(po);
                if (po.getDeploymentStatus().isCompleted()) {
                    completed = true;
                } else {
                    log.warn("Unable to start some modules for " + file.getAbsolutePath());
                }
                modules = po.getResultTargetModuleIDs();
                for (int i = 0; i < modules.length; i++) {
                    TargetModuleID result = modules[i];
                    log.info(DeployUtils.reformat("Deployed " + result.getModuleID() + (targets.length > 1 ? " to " + result.getTarget().getName() : "") + (result.getWebURL() == null ? "" : " @ " + result.getWebURL()), 4, 72));
                    if (result.getChildTargetModuleID() != null) {
                        for (int j = 0; j < result.getChildTargetModuleID().length; j++) {
                            TargetModuleID child = result.getChildTargetModuleID()[j];
                            log.info(DeployUtils.reformat("  `-> " + child.getModuleID() + (child.getWebURL() == null ? "" : " @ " + child.getWebURL()), 4, 72));
                        }
                    }
                }
            } else {
               //Try to delete the module , that failed to successfully hot-deploy 
              log.error("Unable to deploy: " + po.getDeploymentStatus().getMessage());
              String delfile=file.getAbsolutePath();
                File fd = new File(delfile);
                if(fd.isDirectory()){
                     log.info("Deleting the Directory: "+delfile);
                     if(DeploymentUtil.recursiveDelete(fd))
View Full Code Here

        try {
            mgr = getDeploymentManager();
            Target[] targets = mgr.getTargets();
            TargetModuleID[] ids = mgr.getAvailableModules(null, targets);
            ids = (TargetModuleID[]) DeployUtils.identifyTargetModuleIDs(ids, configId, true).toArray(new TargetModuleID[0]);
            ProgressObject po = mgr.undeploy(ids);
            waitForProgress(po);
            if (po.getDeploymentStatus().isCompleted()) {
                TargetModuleID[] modules = po.getResultTargetModuleIDs();
                for (int i = 0; i < modules.length; i++) {
                    TargetModuleID result = modules[i];
                    log.info(DeployUtils.reformat("Undeployed " + result.getModuleID() + (targets.length > 1 ? " to " + result.getTarget().getName() : ""), 4, 72));
                }
            } else {
                log.error("Unable to undeploy " + file.getAbsolutePath() + "(" + configId + ")" + po.getDeploymentStatus().getMessage());
                return false;
            }
        } catch (DeploymentManagerCreationException e) {
            log.error("Unable to open deployer", e);
            return false;
View Full Code Here

    protected String getAction() {
        return "Deployed";
    }

    protected ProgressObject runCommand(DeploymentManager mgr, ConsoleReader out, boolean inPlace, Target[] tlist, File module, File plan) throws DeploymentException {
        ProgressObject po = super.runCommand(mgr, out, inPlace, tlist, module, plan);
        waitForProgress(out, po);
        if(po.getDeploymentStatus().isFailed()) {
            throw new DeploymentException("Unable to distribute "+(module == null ? plan.getName() : module.getName())+": "+po.getDeploymentStatus().getMessage());
        }
        return mgr.start(po.getResultTargetModuleIDs());
    }
View Full Code Here

        try {
            mgr = getDeploymentManager();
            Target[] targets = mgr.getTargets();
            TargetModuleID[] ids = mgr.getAvailableModules(null, targets);
            ids = (TargetModuleID[]) DeployUtils.identifyTargetModuleIDs(ids, configId, true).toArray(new TargetModuleID[0]);
            ProgressObject po;
            if (DeployUtils.isJarFile(file) || file.isDirectory()) {
                po = mgr.redeploy(ids, file, null);
            } else {
                po = mgr.redeploy(ids, null, file);
            }
            waitForProgress(po);
            if (po.getDeploymentStatus().isCompleted()) {
                modules = po.getResultTargetModuleIDs();
                for (int i = 0; i < modules.length; i++) {
                    TargetModuleID result = modules[i];
                    log.info(DeployUtils.reformat("Redeployed " + result.getModuleID() + (targets.length > 1 ? " to " + result.getTarget().getName() : "") + (result.getWebURL() == null ? "" : " @ " + result.getWebURL()), 4, 72));
                    if (result.getChildTargetModuleID() != null) {
                        for (int j = 0; j < result.getChildTargetModuleID().length; j++) {
                            TargetModuleID child = result.getChildTargetModuleID()[j];
                            log.info(DeployUtils.reformat("  `-> " + child.getModuleID() + (child.getWebURL() == null ? "" : " @ " + child.getWebURL()), 4, 72));
                        }
                    }
                }
            } else {
                log.error("Unable to undeploy " + file.getAbsolutePath() + "(" + configId + ")" + po.getDeploymentStatus().getMessage());
            }
        } catch (DeploymentManagerCreationException e) {
            log.error("Unable to open deployer", e);
        } catch (Exception e) {
            log.error("Unable to undeploy", e);
View Full Code Here

                if (null == targets) {
                    throw new IllegalStateException("No target to distribute to");
                }
                targets = new Target[] {targets[0]};
               
                ProgressObject po = mgr.distribute(targets, null, tempFile);
                waitForProgress(po);
                if (po.getDeploymentStatus().isCompleted()) {
                    TargetModuleID[] ids = po.getResultTargetModuleIDs();
                    po = mgr.start(ids);
                    waitForProgress(po);
                    if (po.getDeploymentStatus().isCompleted()) {
                        log.info("Deployment completed successfully!");
                    }
                }
            } catch (IOException e) {
                log.error("Unable to save security realm", e);
View Full Code Here

TOP

Related Classes of javax.enterprise.deploy.spi.status.ProgressObject

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.