Examples of DeploymentStatus


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

    public void testDistributeEARApp() throws Exception {
        DeploymentManager manager = getDeploymentManager();
        ProgressObject progress = jsr88Deploy(manager, getEarArchive());
        TargetModuleID[] targetModules = progress.getResultTargetModuleIDs();
        try {
            DeploymentStatus state = progress.getDeploymentStatus();
            assertEquals(StateType.COMPLETED, state.getState());
            assertServletAccess("custom-context");
        } finally {
            jsr88Undeploy(manager, targetModules);
        }
        try {
View Full Code Here

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

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

        // [AS7-3474] JSR88 undeployment does not work

        DeploymentManager manager = getDeploymentManager();
        ProgressObject progress = jsr88Deploy(manager, getEarArchive());

        DeploymentStatus state = progress.getDeploymentStatus();
        assertEquals(StateType.COMPLETED, state.getState());
        assertServletAccess("custom-context");

        Target[] targets = manager.getTargets();
        TargetModuleID[] targetModules = manager.getAvailableModules(ModuleType.EAR, targets);
        assertEquals(1, targetModules.length);
View Full Code Here

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

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

    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

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

        //
       
        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

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

            }

            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

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

           }

           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

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

          }

          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

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

                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
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.