Package javax.enterprise.deploy.spi

Examples of javax.enterprise.deploy.spi.Target


        Target[] tlist = new Target[targetNames.size()];
        Target[] all = mgr.getTargets();
        Set found = new HashSet();
        for (int i = 0; i < tlist.length; i++) {
            for (int j = 0; j < all.length; j++) {
                Target server = all[j];
                // check for exact target name match
                if (server.getName().equals(targetNames.get(i))
                        // check for "target-nickname" match (they match if
                        // the full target name contains the user-provided
                        // nickname)
                        || server.getName().indexOf(targetNames.get(i).toString()) > -1) {
                    tlist[i] = server;
                    if (found.contains(server.getName())) {
                        throw new DeploymentException("Target list should not contain duplicates or nicknames that match duplicates (" + targetNames.get(i) + ")");
                    }
                    found.add(server.getName());
                    break;
                }
            }
            if (tlist[i] == null) {
                throw new DeploymentException("No target named or matching '" + targetNames.get(i) + "' was found");
View Full Code Here


            }
            consoleReader.printNewline();
           
            // for each target, print the modules that were deployed to it
            for (int i = 0; (tlist != null) && (i < tlist.length); i++) {
                Target target = tlist[i];
                if (tlist.length > 1) {
                    consoleReader.printNewline();
                    consoleReader.printString(" Target " + target);
                    consoleReader.printNewline();
                }
View Full Code Here

                consoleReader.printNewline();
            } else {
                consoleReader.printString("Available Targets:");
                consoleReader.printNewline();
                for (int i = 0; i < list.length; i++) {
                    Target target = list[i];
                    consoleReader.printString("  "+target.getName());
                    consoleReader.printNewline();
                }
            }
        } catch (IOException e) {
            throw new DeploymentException("Could not write to console", e);
View Full Code Here

            for (int i = 0; i < targetModuleIDs.length; i++) {
                /*
                 *Make sure that this target module ID has a target that is a TargetImpl and was created by this DM.
                 */
                Target candidateTarget = targetModuleIDs[i].getTarget();
                if ( ! (candidateTarget instanceof TargetImpl)) {
                    throw new IllegalArgumentException(
                    localStrings.getLocalString("enterprise.deployapi.spi.nott", //NOI18N
                        "Expected TargetImpl instance but found instance of {0}", new Object[] {candidateTarget.getClass().getName() } )); //NOI18N
                }
                String moduleID = targetModuleIDs[i].getModuleID();
               
                /*
                 *Look for the entry in the hash map for this module.
View Full Code Here

                    targetModuleIDList.add(targetModuleID);
                }
            }

            // then undeploy from last target
            Target lastTarget = targets[targets.length -1];
            undeploymentOptions.put(DFDeploymentProperties.TARGET, lastTarget.getName());
            DFCommandRunner commandRunner2 = getDFCommandRunner(
                    "undeploy",
                    undeploymentOptions,
                    new String[]{moduleID});
            DFDeploymentStatus ds2 = commandRunner2.run();
            DFDeploymentStatus mainStatus2 = ds2.getMainStatus();
            if (!po.checkStatusAndAddStage((TargetImpl)lastTarget, localStrings.getLocalString("enterprise.deployment.client.undeploy_from_target", "Trying to undeploy application from target {0}", lastTarget.getName()), mainStatus2)) {
                return po;
            }

            TargetModuleIDImpl targetModuleID =
                new TargetModuleIDImpl((TargetImpl)lastTarget, moduleID);
View Full Code Here

            Map tmpMap = new HashMap();
            synchronized(nameToInfo) {
                tmpMap.putAll(nameToInfo);
            }
            for (int i = 0; i < moduleIDList.length; i++) {
                Target target= moduleIDList[i].getTarget();
                if ( null == nameToInfo.get(target.getName()) ) {
                    throw new IllegalArgumentException(
                        target + " does not exist.");
                }
            }
            for (int i = 0; i < moduleIDList.length; i++) {
                Target target= moduleIDList[i].getTarget();
                ServerInfo info =
                    (ServerInfo) tmpMap.get(target.getName());
                ProgressObject progress =
                    aCommand.execute(info.server,
                        new TargetModuleID[] {moduleIDList[i]});
                addResult(progress);
            }
View Full Code Here

        Target[] tlist = new Target[targetNames.size()];
        Target[] all = mgr.getTargets();
        Set found = new HashSet();
        for (int i = 0; i < tlist.length; i++) {
            for (int j = 0; j < all.length; j++) {
                Target server = all[j];
                // check for exact target name match
                if (server.getName().equals(targetNames.get(i))
                        // check for "target-nickname" match (they match if
                        // the full target name contains the user-provided
                        // nickname)
                        || server.getName().indexOf(targetNames.get(i).toString()) > -1) {
                    tlist[i] = server;
                    if (found.contains(server.getName())) {
                        throw new DeploymentException("Target list should not contain duplicates or nicknames that match duplicates (" + targetNames.get(i) + ")");
                    }
                    found.add(server.getName());
                    break;
                }
            }
            if (tlist[i] == null) {
                throw new DeploymentException("No target named or matching '" + targetNames.get(i) + "' was found");
View Full Code Here

            }
            consoleReader.printNewline();
           
            // for each target, print the modules that were deployed to it
            for (int i = 0; (tlist != null) && (i < tlist.length); i++) {
                Target target = tlist[i];
                if (tlist.length > 1) {
                    consoleReader.printNewline();
                    consoleReader.printString(" Target " + target);
                    consoleReader.printNewline();
                }
View Full Code Here

                consoleReader.printNewline();
            } else {
                consoleReader.printString("Available Targets:");
                consoleReader.printNewline();
                for (int i = 0; i < list.length; i++) {
                    Target target = list[i];
                    consoleReader.printString("  "+target.getName());
                    consoleReader.printNewline();
                }
            }
        } catch (IOException e) {
            throw new DeploymentException("Could not write to console", e);
View Full Code Here

            out.println("");
        }

        // for each target, print the modules that were deployed to it
        for (int i = 0; (tlist != null) && (i < tlist.length); i++) {
            Target target = tlist[i];
            if (tlist.length > 1)
                out.println("\n Target " + target);
            printTargetModules(out, target, running, "  + ");
            printTargetModules(out, target, notrunning, "    ");
        }
View Full Code Here

TOP

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

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.