Package javax.enterprise.deploy.spi

Examples of javax.enterprise.deploy.spi.TargetModuleID


        List modulesList = new ArrayList();

        DeploymentManager manager = getDeploymentManager();

        Target[] targets = manager.getTargets();
        TargetModuleID runningModuleIds[] = manager.getRunningModules(null, targets);

        for (int j = 0; j < moduleIds.length; j++) {
            String moduleId = moduleIds[j].getModuleID();
            log.debug("Checking if module is running: " + moduleId);
View Full Code Here


        log.debug("Checking if module is started: " + moduleId);
       
        DeploymentManager manager = getDeploymentManager();

        Target[] targets = manager.getTargets();
        TargetModuleID targetIds[] = manager.getRunningModules(null, targets);

        for (int i = 0; i < targetIds.length; i++) {
            if (moduleId.equals(targetIds[i].getModuleID())) {
                return true;
            }
View Full Code Here

            messageStatus += "    ";
            messageStatus += idChild.getModuleID()+(idChild.getWebURL() == null || !action.equals(START_ACTION) ? "" : " @ "+idChild.getWebURL());
            messageStatus += "<br />";
            if (idChild.getChildTargetModuleID() != null) {
                for (int j = 0; j < idChild.getChildTargetModuleID().length; j++) {
                    TargetModuleID child = idChild.getChildTargetModuleID()[j];
                    messageStatus += "      `-> "+child.getModuleID()+(child.getWebURL() == null || !action.equals(START_ACTION) ? "" : " @ "+child.getWebURL());
                    messageStatus += "<br />";
                }
            }
            messageStatus += "<br />";
View Full Code Here

                } 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 
View Full Code Here

            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;
            }
View Full Code Here

            }
            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());
View Full Code Here

        boolean multiple = isMultipleTargets(ids);
        ProgressObject po = mgr.redeploy(ids, module, plan);
        waitForProgress(out, po);
        TargetModuleID[] done = po.getResultTargetModuleIDs();
        for(int i = 0; i < done.length; i++) {
            TargetModuleID id = done[i];
            emit("Redeployed "+id.getModuleID()+(multiple ? " on "+id.getTarget().getName() : "")+(id.getWebURL() == null ? "" : " @ "+id.getWebURL()));
            if(id.getChildTargetModuleID() != null) {
                for (int j = 0; j < id.getChildTargetModuleID().length; j++) {
                    TargetModuleID child = id.getChildTargetModuleID()[j];
                    emit("  `-> "+child.getModuleID()+(child.getWebURL() == null ? "" : " @ "+child.getWebURL()));
                }
            }
        }
        if(po.getDeploymentStatus().isFailed()) {
            throw new DeploymentException("Operation failed: "+po.getDeploymentStatus().getMessage());
View Full Code Here

        boolean multiple = isMultipleTargets(ids);
        ProgressObject po = runCommand(out, mgr, ids);
        TargetModuleID[] done = po.getResultTargetModuleIDs();
        out.println();
        for(int i = 0; i < done.length; i++) {
            TargetModuleID id = done[i];
            out.print(DeployUtils.reformat(getAction()+" "+id.getModuleID()+((multiple && id.getTarget() != null) ? " on "+ id.getTarget().getName() : "")+(id.getWebURL() == null || !getAction().equals("Started") ? "" : " @ "+id.getWebURL()),4, 72));
            if(id.getChildTargetModuleID() != null) {
                for (int j = 0; j < id.getChildTargetModuleID().length; j++) {
                    TargetModuleID child = id.getChildTargetModuleID()[j];
                    out.print(DeployUtils.reformat("  `-> "+child.getModuleID()+(child.getWebURL() == null || getAction().toLowerCase().indexOf("started") == -1 ? "" : " @ "+child.getWebURL()),4, 72));
                }
            } // Also print childs if existing in earlier configuration
            else{
                java.util.Iterator iterator = DeployUtils.identifyTargetModuleIDs(allModules, id.getModuleID(), false).iterator();
                if(iterator.hasNext()){
                    TargetModuleID childs = (TargetModuleID)iterator.next();
                    if(childs.getChildTargetModuleID() != null) {
                        for (int j = 0; j < childs.getChildTargetModuleID().length; j++) {
                            TargetModuleID child = childs.getChildTargetModuleID()[j];
                            out.print(DeployUtils.reformat("  `-> "+child.getModuleID()+(child.getWebURL() == null || getAction().toLowerCase().indexOf("started") == -1 ? "" : " @ "+child.getWebURL()),4, 72));
                        }
                    }
                }
            }
            out.println();
View Full Code Here

    }

    protected static boolean isMultipleTargets(TargetModuleID[] ids) {
        Set set = new HashSet();
        for(int i = 0; i < ids.length; i++) {
            TargetModuleID id = ids[i];
            set.add(id.getTarget().getName());
        }
        return set.size() > 1;
    }
View Full Code Here

     * @param prefix a <code>String</code> value that will be
     * prepended to each module
     */
    void printTargetModules(PrintWriter out, Target target, TargetModuleID[] modules, String prefix) {
        for (int i = 0; i < modules.length; i++) {
            TargetModuleID result = modules[i];
            if (result.getTarget().equals(target)) {
                out.println(prefix+result.getModuleID());
                if(result.getChildTargetModuleID() != null) {
                    for (int j = 0; j < result.getChildTargetModuleID().length; j++) {
                        TargetModuleID child = result.getChildTargetModuleID()[j];
                        out.println("      `-> "+child.getModuleID());
                    }
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of javax.enterprise.deploy.spi.TargetModuleID

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.