Package javax.enterprise.deploy.spi.status

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


    protected Object customReplaceObject(Object obj) throws IOException {
      if ( obj instanceof ModuleType ) {
            return new ModuleTypeWrapper((ModuleType) obj);
        } else if ( obj instanceof DeploymentStatus ) {
            DeploymentStatus status = (DeploymentStatus) obj;
            return new DeploymentStatusImpl(status.getCommand(),
                status.getAction(), status.getState(), status.getMessage());
        }
        return null;
    }
View Full Code Here


        ActionType actionType = null;
        boolean completed = true;
        boolean failed = false;
        for (Iterator iter = progressObjects.iterator(); iter.hasNext();) {
            ProgressObject progress = (ProgressObject) iter.next();
            DeploymentStatus status = progress.getDeploymentStatus();
            CommandType curCommandType = status.getCommand();
            ActionType curActionType = status.getAction();
            if ( null == commandType ) {
                commandType = curCommandType;
                actionType = curActionType;
            } else if ( commandType != curCommandType ) {
                throw new AssertionError("Heterogeneous CommandType");
            } else if ( actionType != curActionType ) {
                throw new AssertionError("Heterogeneous ActionType");
            }
            message.append(status.getMessage() + "\n");
            if ( StateType.FAILED == status.getState() ) {
                failed = true;
            } else if ( StateType.COMPLETED != status.getState() ) {
                completed = false;
            }
            commandType = status.getCommand();
            actionType = status.getAction();
        }
        if ( failed ) {
            return new DeploymentStatusImpl(commandType, actionType,
                StateType.FAILED, message.toString());
        } else if ( completed ) {
View Full Code Here

        mockProgressObject.status =
            new DeploymentStatusImpl(CommandType.DISTRIBUTE,
                ActionType.EXECUTE, StateType.RUNNING, null);
        progressObject.addProgressObject(mockProgressObject);
        progressObject.consolidate();
        DeploymentStatus status = progressObject.getDeploymentStatus();
        assertEquals(StateType.RUNNING, status.getState());
    }
View Full Code Here

        mockProgressObject.status =
            new DeploymentStatusImpl(CommandType.DISTRIBUTE,
                ActionType.EXECUTE, StateType.FAILED, null);
        progressObject.addProgressObject(mockProgressObject);
        progressObject.consolidate();
        DeploymentStatus status = progressObject.getDeploymentStatus();
        assertEquals(StateType.FAILED, status.getState());
    }
View Full Code Here

        mockProgressObject.status =
            new DeploymentStatusImpl(CommandType.DISTRIBUTE,
                ActionType.EXECUTE, StateType.COMPLETED, null);
        progressObject.addProgressObject(mockProgressObject);
        progressObject.consolidate();
        DeploymentStatus status = progressObject.getDeploymentStatus();
        assertEquals(StateType.COMPLETED, 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 = getDeploymentStatus();
            toNotify = (ProgressListener[]) listeners.toArray(new ProgressListener[listeners.size()]);
View Full Code Here

                    String url = moduleIds[i].getWebURL();
                    log.info("Starting module: " + moduleIds[i].getModuleID() + (url == null ? "" : ("; URL: " + url)));
                }

                ProgressObject progress = getDeploymentManager().start(moduleIds);
                DeploymentStatus status = waitFor(progress);

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

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

            throw new IllegalStateException("No target to distribute to");
        }
        targets = new Target[] {targets[0]};
       
        ProgressObject progress = manager.distribute(targets, file, plan);
        DeploymentStatus status = waitFor(progress);

        if (status.isFailed()) {
            //
            // FIXME: There must be a better way to handle this.
            //
            if (status.getMessage().indexOf("already exists") < 0 ) {
                throw new MojoExecutionException("Distribution failed: " + status.getMessage());
            }
            log.info("Module already exists");
        }
       
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

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.