Examples of TargetModuleIDImpl


Examples of org.apache.geronimo.deployment.plugin.TargetModuleIDImpl

     * modules and add a WebURL to each if possible.
     */
    public static void addWebContextPaths(Kernel kernel, List moduleIDs) throws Exception{
        Set webApps = null;
        for (int i = 0; i < moduleIDs.size(); i++) {
            TargetModuleIDImpl id = (TargetModuleIDImpl) moduleIDs.get(i);
            if(id.getType() != null && id.getType().getValue() == ModuleType.WAR.getValue()) {
                if(webApps == null) {
                    webApps = kernel.listGBeans(new AbstractNameQuery("org.apache.geronimo.management.geronimo.WebModule"));
                }
                for (Iterator it = webApps.iterator(); it.hasNext();) {
                    AbstractName name = (AbstractName) it.next();
                    if(name.getName().get("name").equals(id.getModuleID())) {
                        id.setWebURL(kernel.getAttribute(name, "contextPath").toString());
                    }
                }
            }
            if(id.getChildTargetModuleID() != null) {
                addWebContextPaths(kernel, Arrays.asList(id.getChildTargetModuleID()));
            }
        }
    }
View Full Code Here

Examples of org.apache.geronimo.deployment.plugin.TargetModuleIDImpl

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

                    Artifact moduleID = Artifact.create(module.getModuleID());
                    try {
                      if(!configurationManager.isOnline()) {
                        //If an offline undeploy, need to load the configuration first, so that stopConfiguration()
                        //can resolve the configuration and successfully set load=false in attribute manager, otherwise
                        //starting the server will fail attempting to start an config that does not exist.
View Full Code Here

Examples of org.apache.geronimo.deployment.plugin.TargetModuleIDImpl

                                //TODO might be a hack
                                List kidsChild = loadChildren(kernel, config.toString());
                                //this.updateStatus("printing kidsChild="+kidsChild);
                                //this.updateStatus("printing config="+config.toString());
                                // Build a response obect containg the started configuration and a list of it's contained modules
                                TargetModuleIDImpl idChild = new TargetModuleIDImpl(null, config.toString(),
                                        (String[]) kidsChild.toArray(new String[kidsChild.size()]));
                                if (isWebApp(kernel, config.toString())) {
                                    idChild.setType(ModuleType.WAR);
                                }
                                if (idChild.getChildTargetModuleID() != null) {
                                    for (int k = 0; k < idChild.getChildTargetModuleID().length; k++) {
                                        TargetModuleIDImpl child = (TargetModuleIDImpl) idChild.getChildTargetModuleID()[k];
                                        if (isWebApp(kernel, child.getModuleID())) {
                                            child.setType(ModuleType.WAR);
                                        }
                                    }
                                }
                                addModule(idChild);
                            }
View Full Code Here

Examples of org.apache.geronimo.deployment.plugin.TargetModuleIDImpl

            }

            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
            try {
                for (int i = 0; i < modules.length; i++) {
                    TargetModuleIDImpl module = (TargetModuleIDImpl) modules[i];
                    Artifact artifact = Artifact.create(module.getModuleID());
                    if(configID != null && configID.isResolved()) {
                        if(configID.getGroupId().equals(artifact.getGroupId()) &&
                                configID.getArtifactId().equals(artifact.getArtifactId()) &&
                                configID.getVersion().equals(artifact.getVersion())) {
                            redeploySameConfiguration(configurationManager, artifact, module.getTarget());
                        } else {
                            redeployUpdatedConfiguration(configurationManager, artifact, module.getTarget());
                        }
                    } else {
                        redeployUpdatedConfiguration(configurationManager, artifact, module.getTarget());
                    }
                }
            } finally {
                ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
            }
View Full Code Here

Examples of org.apache.geronimo.deployment.plugin.TargetModuleIDImpl

            //TODO might be a hack
            List kidsChild = loadChildren(kernel, config.toString());

            // Build a response obect containg the started configuration and a list of it's contained modules
            TargetModuleIDImpl idChild = new TargetModuleIDImpl(null, config.toString(),
                                                                (String[]) kidsChild.toArray(new String[kidsChild.size()]));
            if (isWebApp(kernel, config.toString())) {
                idChild.setType(ModuleType.WAR);
            }
            if (idChild.getChildTargetModuleID() != null) {
                for (int k = 0; k < idChild.getChildTargetModuleID().length; k++) {
                    TargetModuleIDImpl child = (TargetModuleIDImpl) idChild.getChildTargetModuleID()[k];
                    if (isWebApp(kernel, child.getModuleID())) {
                        child.setType(ModuleType.WAR);
                    }
                }
            }
            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

Examples of org.apache.geronimo.deployment.plugin.TargetModuleIDImpl

     * modules and add a WebURL to each if possible.
     */
    public static void addWebURLs(Kernel kernel, List moduleIDs) throws Exception{
        Set webApps = null;
        for (int i = 0; i < moduleIDs.size(); i++) {
            TargetModuleIDImpl id = (TargetModuleIDImpl) moduleIDs.get(i);
            if(id.getType() != null && id.getType().getValue() == ModuleType.WAR.getValue()) {
                if(webApps == null) {
                    webApps = kernel.listGBeans(new AbstractNameQuery("org.apache.geronimo.management.geronimo.WebModule"));
                }
                for (Iterator it = webApps.iterator(); it.hasNext();) {
                    AbstractName name = (AbstractName) it.next();
                    if(name.getName().get("name").equals(id.getModuleID())) {
                        id.setWebURL(kernel.getAttribute(name, "URLFor").toString());
                    }
                }
            }
            if(id.getChildTargetModuleID() != null) {
                addWebURLs(kernel, Arrays.asList(id.getChildTargetModuleID()));
            }
        }
    }
View Full Code Here

Examples of org.apache.geronimo.deployment.plugin.TargetModuleIDImpl

            }

            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
            try {
                for (int i = 0; i < modules.length; i++) {
                    TargetModuleIDImpl module = (TargetModuleIDImpl) modules[i];
                    Artifact artifact = Artifact.create(module.getModuleID());
                    if(configID != null && configID.isResolved()) {
                        if(configID.getGroupId().equals(artifact.getGroupId()) &&
                                configID.getArtifactId().equals(artifact.getArtifactId()) &&
                                configID.getVersion().equals(artifact.getVersion())) {
                            redeploySameConfiguration(configurationManager, artifact, module.getTarget());
                        } else {
                            redeployUpdatedConfiguration(configurationManager, artifact, module.getTarget());
                        }
                    } else {
                        redeployUpdatedConfiguration(configurationManager, artifact, module.getTarget());
                    }
                }
            } finally {
                ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
            }
View Full Code Here

Examples of org.glassfish.deployapi.TargetModuleIDImpl

                DFDeploymentStatus ds = commandRunner.run();
                DFDeploymentStatus mainStatus = ds.getMainStatus();
                if(!po.checkStatusAndAddStage((TargetImpl)target, localStrings.getLocalString("enterprise.deployment.client.change_state", "{0} of {1} in target {2}", action, moduleID, target.getName()), mainStatus)) {
                    return po;
                } else {
                    TargetModuleIDImpl targetModuleID =
                        new TargetModuleIDImpl((TargetImpl)target, moduleID);
                    targetModuleIDList.add(targetModuleID);
                }
            }
            TargetModuleIDImpl[] targetModuleIDs =
                new TargetModuleIDImpl[targetModuleIDList.size()];
View Full Code Here

Examples of org.jboss.deployment.spi.TargetModuleIDImpl

   /**
    * Deploy a given module
    */
   public void deploy(TargetModuleID targetModuleID) throws Exception
   {
      TargetModuleIDImpl moduleID = (TargetModuleIDImpl)targetModuleID;
      SerializableTargetModuleID smoduleID = new SerializableTargetModuleID(moduleID);
      Client client = getClient();
      log.info("Begin deploy: " + moduleID);
      transferDeployment(client, smoduleID);
      log.info("End deploy");
View Full Code Here

Examples of org.jboss.deployment.spi.TargetModuleIDImpl

         {
            SerializableTargetModuleID id = modules[n];
            String moduleID = id.getModuleID();
            boolean isRunning = id.isRunning();
            ModuleType type = ModuleType.getModuleType(id.getModuleType());
            TargetModuleIDImpl tmid = new TargetModuleIDImpl(this, moduleID, null, isRunning, type);
            convertChildren(tmid, id);
            list.add(tmid);
         }

         TargetModuleID[] targetModuleIDs = new TargetModuleID[list.size()];
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.