Examples of TargetModuleID


Examples of javax.enterprise.deploy.spi.TargetModuleID

    }

    private static Set<TargetModuleID> toTargetModuleIds(Collection<AppInfo> deployedApps, ModuleType allowedModuleType) {
        Set<TargetModuleID> targetModuleIds = new HashSet<TargetModuleID>(deployedApps.size());
        for (AppInfo deployedApp : deployedApps) {
            TargetModuleID moduleId = toTargetModuleId(deployedApp, allowedModuleType);
            // moduleID will be null if the module was filtered
            if (moduleId != null) {
                targetModuleIds.add(moduleId);
            }
        }
View Full Code Here

Examples of javax.enterprise.deploy.spi.TargetModuleID

            return new ProgressObjectImpl(CommandType.DISTRIBUTE, Collections.<TargetModuleID>emptySet());
        }

        try {
            AppInfo appInfo = getDeployer().deploy(properties);
            TargetModuleID targetModuleId = toTargetModuleId(appInfo, null);

            return new ProgressObjectImpl(CommandType.DISTRIBUTE, Collections.singleton(targetModuleId));
        } catch (OpenEJBException e) {
            return new ProgressObjectImpl(CommandType.DISTRIBUTE, e);
        }
View Full Code Here

Examples of javax.enterprise.deploy.spi.TargetModuleID

    public void execute() throws Exception {
        DeploymentManager manager = getDeploymentManager();

        Target[] targets = manager.getTargets();
        TargetModuleID moduleIds[] = manager.getRunningModules(null, targets);
        List toStop = new ArrayList(moduleIds.length);
        for (int i = 0; i < moduleIds.length; i++) {
            TargetModuleID moduleId = moduleIds[i];
            if (getId().equals(moduleId.getModuleID())) {
                toStop.add(moduleId);
            }
        }
        if (toStop.size() == 0) {
            System.out.println("Module is not running or not deployed: " + getId());
View Full Code Here

Examples of javax.enterprise.deploy.spi.TargetModuleID

                } 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];
                    System.out.print(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];
                            System.out.print(DeployUtils.reformat("  `-> " + child.getModuleID() + (child.getWebURL() == null ? "" : " @ " + child.getWebURL()), 4, 72));
                        }
                    }
                }
            } else {
                log.error("Unable to deploy: " + po.getDeploymentStatus().getMessage());
View Full Code Here

Examples of javax.enterprise.deploy.spi.TargetModuleID

        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

Examples of javax.enterprise.deploy.spi.TargetModuleID

    public void run() {
        try {
            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
            try {
                for (int i = 0; i < modules.length; i++) {
                    TargetModuleID module = modules[i];

                    // Check to see whether the module is already started
                    Artifact moduleID = Artifact.create(module.getModuleID());
                    if (configurationManager.isRunning(moduleID)) {
                        updateStatus("Module " + moduleID + " is already running");
                        Thread.sleep(100);
                        continue;
                    }

                    // Load
                    if(!configurationManager.isLoaded(moduleID)) {
                        configurationManager.loadConfiguration(moduleID);
                    }

                    // Start
                    configurationManager.startConfiguration(moduleID);

                    // Determine the child modules of the configuration
                    //TODO might be a hack
                    List kids = loadChildren(kernel, moduleID.toString());

                    // Build a response obect containg the started configuration and a list of it's contained modules
                    TargetModuleIDImpl id = new TargetModuleIDImpl(modules[i].getTarget(), module.getModuleID(),
                            (String[]) kids.toArray(new String[kids.size()]));
                    if (isWebApp(kernel, moduleID.toString())) {
                        id.setType(ModuleType.WAR);
                    }
                    if (id.getChildTargetModuleID() != null) {
View Full Code Here

Examples of javax.enterprise.deploy.spi.TargetModuleID

            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];
                    System.out.print(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

Examples of javax.enterprise.deploy.spi.TargetModuleID

            }
            waitForProgress(po);
            if (po.getDeploymentStatus().isCompleted()) {
                TargetModuleID[] modules = po.getResultTargetModuleIDs();
                for (int i = 0; i < modules.length; i++) {
                    TargetModuleID result = modules[i];
                    System.out.print(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];
                            System.out.print(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

Examples of javax.enterprise.deploy.spi.TargetModuleID

    public void run() {
        try {
            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
            try {
                for (int i = 0; i < modules.length; i++) {
                    TargetModuleID module = modules[i];
                    Artifact moduleID = Artifact.create(module.getModuleID());
                    if(configurationManager.isRunning(moduleID)) {
                        configurationManager.stopConfiguration(moduleID);
                    }
                    if(configurationManager.isLoaded(moduleID)) {
                        configurationManager.unloadConfiguration(moduleID);
View Full Code Here

Examples of javax.enterprise.deploy.spi.TargetModuleID

    public void execute() throws Exception {
        DeploymentManager manager = getDeploymentManager();

        Target[] targets = manager.getTargets();
        TargetModuleID moduleIds[] = manager.getNonRunningModules(null, targets);
        List toUndeploy = new ArrayList(moduleIds.length);
        for (int i = 0; i < moduleIds.length; i++) {
            TargetModuleID moduleId = moduleIds[i];
            if (getId().equals(moduleId.getModuleID())) {
                toUndeploy.add(moduleId);
            }
        }
        if (toUndeploy.size() == 0) {
            System.out.println("Module is running or not deployed: " + getId());
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.