Package javax.enterprise.deploy.spi.status

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


    private StateType awaitCompletion(ProgressObject progress, long timeout) throws InterruptedException {
        final CountDownLatch latch = new CountDownLatch(1);
        progress.addProgressListener(new ProgressListener() {
            public void handleProgressEvent(ProgressEvent event) {
                DeploymentStatus status = event.getDeploymentStatus();
                if (status.isCompleted() || status.isFailed()) {
                    latch.countDown();
                }
            }
        });

        final DeploymentStatus status = progress.getDeploymentStatus();
        if (status.isCompleted())
            return status.getState();

        if (latch.await(timeout, TimeUnit.MILLISECONDS) == false)
            throw new IllegalStateException("Deployment timeout: " + progress);

        return status.getState();
    }
View Full Code Here


    private void sendEvent(String message, StateType state) {
        assert !Thread.holdsLock(this) : "Trying to send event whilst holding lock";

        ProgressListener[] toNotify;
        DeploymentStatus newStatus;
        synchronized (this) {
            this.message = message;
            this.state = state;
            newStatus = new Status(command, action, state, message);
            toNotify = (ProgressListener[]) listeners.toArray(new ProgressListener[listeners.size()]);
View Full Code Here

        //
       
        ProgressListener listener = new ProgressListener()
        {
            public void handleProgressEvent(final ProgressEvent event) {
                DeploymentStatus status = event.getDeploymentStatus();

                if (!status.isRunning()) {
                    synchronized (progress) {
                        progress.notify();
                    }
                }
            }
View Full Code Here

            }

            log.info("Starting module: " + moduleId);
            ProgressObject progress = manager.start(found);
           
            DeploymentStatus status = waitFor(progress);
            if (status.isFailed()) {
                throw new MojoExecutionException("Failed to start module: " + moduleId);
            }
           
            log.info("Started module(s):");
            logModules(found, "    ");
View Full Code Here

           }

           log.info("Stopping module: " + moduleId);
           ProgressObject progress = manager.stop(found);

           DeploymentStatus status = waitFor(progress);
           if (status.isFailed()) {
               throw new MojoExecutionException("Failed to stop module: " + moduleId);
           }

           log.info("Stopped module(s):");
           logModules(found, "    ");
View Full Code Here

          }

          log.info("Undeploying module: " + moduleId);
          ProgressObject progress = manager.undeploy(found);

          DeploymentStatus status = waitFor(progress);
          if (status.isFailed()) {
              throw new MojoExecutionException("Failed to undeploy module: " + moduleId);
          }

          log.info("Undeployed module(s):");
          logModules(found, "    ");
View Full Code Here

                throw new MojoExecutionException("Just installed plugin cannot be located");
            }
            TargetModuleID[] ids = new TargetModuleID[]{id};

            ProgressObject progress = getDeploymentManager2().start(ids);
            DeploymentStatus status = null;
            try {
                status = waitFor(progress);
            } catch (InterruptedException e) {
                throw new MojoExecutionException("Interrupted waiting for start completion", e);
            }

            if (status.isFailed()) {
                throw new MojoExecutionException("Failed to start modules: " + status.getMessage());
            }

            getLog().info("Started module(s):");
            logModules(ids, "    ");
        }
View Full Code Here

        //
       
        ProgressListener listener = new ProgressListener()
        {
            public void handleProgressEvent(final ProgressEvent event) {
                DeploymentStatus status = event.getDeploymentStatus();

                if (!status.isRunning()) {
                    synchronized (progress) {
                        progress.notify();
                    }
                }
            }
View Full Code Here

            }

            log.info("Starting module: " + moduleId);
            ProgressObject progress = manager.start(found);
           
            DeploymentStatus status = waitFor(progress);
            if (status.isFailed()) {
                throw new MojoExecutionException("Failed to start module: " + moduleId);
            }
           
            log.info("Started module(s):");
            logModules(found, "    ");
View Full Code Here

           }

           log.info("Stopping module: " + moduleId);
           ProgressObject progress = manager.stop(found);

           DeploymentStatus status = waitFor(progress);
           if (status.isFailed()) {
               throw new MojoExecutionException("Failed to stop module: " + moduleId);
           }

           log.info("Stopped module(s):");
           logModules(found, "    ");
View Full Code Here

TOP

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

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.