Examples of TargetModuleIDImpl


Examples of com.caucho.j2ee.deployclient.TargetModuleIDImpl

    Throwable exception = null;

    TargetImpl childTarget = new TargetImpl(moduleID, "");
   
    TargetModuleIDImpl childModuleID
      = new TargetModuleIDImpl(childTarget, moduleID);
   
    if (mxbean != null) {
      try {
        Path deployPath = Vfs.lookup(mxbean.getArchivePath(name));
View Full Code Here

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

                    // 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) {
                        for (int k = 0; k < id.getChildTargetModuleID().length; k++) {
                            TargetModuleIDImpl child = (TargetModuleIDImpl) id.getChildTargetModuleID()[k];
                            if (isWebApp(kernel, child.getModuleID())) {
                                child.setType(ModuleType.WAR);
                            }
                        }
                    }
                    addModule(id);
                    java.util.Iterator iterator = lcresult.getStarted().iterator();
                    while (iterator.hasNext()) {
                        Artifact config = (Artifact)iterator.next();
                        if (!config.toString().equals(id.getModuleID())) {
                            //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);
                                    }
                                }
                            }
                            addModule(idChild);                           
                        }
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

                for (Object info1 : infos) {
                    ConfigurationInfo info = (ConfigurationInfo) info1;
                    if (filter.accept(info)) {
                        String name = info.getConfigID().toString();
                        List list = CommandSupport.loadChildren(kernel, name);
                        TargetModuleIDImpl moduleID = new TargetModuleIDImpl(target, name, (String[]) list.toArray(new String[list.size()]));
                        moduleID.setType(CommandSupport.convertModuleType(info.getType()));
                        if (moduleID.getChildTargetModuleID() != null) {
                            for (int k = 0; k < moduleID.getChildTargetModuleID().length; k++) {
                                TargetModuleIDImpl child = (TargetModuleIDImpl) moduleID.getChildTargetModuleID()[k];
                                if (CommandSupport.isWebApp(kernel, child.getModuleID())) {
                                    child.setType(ModuleType.WAR);
                                }
                            }
                        }
                        result.add(moduleID);
                    }
View Full Code Here

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

                for (Object info1 : infos) {
                    ConfigurationInfo info = (ConfigurationInfo) info1;
                    if (filter.accept(info)) {
                        String name = info.getConfigID().toString();
                        List list = CommandSupport.loadChildren(kernel, name);
                        TargetModuleIDImpl moduleID = new TargetModuleIDImpl(target, name, (String[]) list.toArray(new String[list.size()]));
                        moduleID.setType(CommandSupport.convertModuleType(info.getType()));
                        if (moduleID.getChildTargetModuleID() != null) {
                            for (int k = 0; k < moduleID.getChildTargetModuleID().length; k++) {
                                TargetModuleIDImpl child = (TargetModuleIDImpl) moduleID.getChildTargetModuleID()[k];
                                if (CommandSupport.isWebApp(kernel, child.getModuleID())) {
                                    child.setType(ModuleType.WAR);
                                }
                            }
                        }
                        result.add(moduleID);
                    }
View Full Code Here

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

                    // 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) {
                        for (int k = 0; k < id.getChildTargetModuleID().length; k++) {
                            TargetModuleIDImpl child = (TargetModuleIDImpl) id.getChildTargetModuleID()[k];
                            if (isWebApp(kernel, child.getModuleID())) {
                                child.setType(ModuleType.WAR);
                            }
                        }
                    }
                    addModule(id);
                }
View Full Code Here

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

                for (int j = 0; j < infos.size(); j++) {
                    ConfigurationInfo info = (ConfigurationInfo) infos.get(j);
                    if (filter.accept(info)) {
                        String name = info.getConfigID().toString();
                        List list = CommandSupport.loadChildren(kernel, name);
                        TargetModuleIDImpl moduleID = new TargetModuleIDImpl(target, name, (String[]) list.toArray(new String[list.size()]));
                        moduleID.setType(CommandSupport.convertModuleType(info.getType()));
                        if(moduleID.getChildTargetModuleID() != null) {
                            for (int k = 0; k < moduleID.getChildTargetModuleID().length; k++) {
                                TargetModuleIDImpl child = (TargetModuleIDImpl) moduleID.getChildTargetModuleID()[k];
                                if(CommandSupport.isWebApp(kernel, child.getModuleID())) {
                                    child.setType(ModuleType.WAR);
                                }
                            }
                        }
                        result.add(moduleID);
                    }
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) {
        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())) {
                        try {
                            id.setWebURL(kernel.getAttribute(name, "URLFor").toString());
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
            if(id.getChildTargetModuleID() != null) {
                addWebURLs(kernel, Arrays.asList(id.getChildTargetModuleID()));
            }
        }
    }
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.