Examples of TargetModuleIDImpl


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];

                    URI configID = URI.create(module.getModuleID());
                    ObjectName configName = Configuration.getConfigurationObjectName(configID);
                    try {
                        kernel.stopGBean(configName);
                        updateStatus("Stopped "+configID);
                    } catch (GBeanNotFoundException e) {
                        if(e.getGBeanName().equals(configName)) {
                            // The module isn't running -- that's OK
                        } else throw e;
                    }
                    try {
                        configurationManager.unload(configID);
                        updateStatus("Unloaded "+configID);
                    } catch(InternalKernelException e) {
                        Exception cause = (Exception)e.getCause();
                        if(cause instanceof NoSuchConfigException) {
                            // The modules isn't loaded -- that's OK
                        } else {
                            throw cause;
                        }
                    } catch (NoSuchConfigException e) {
                        // The modules isn't loaded -- that's OK
                    }

                    TargetImpl target = (TargetImpl) module.getTarget();
                    ObjectName storeName = target.getObjectName();
                    kernel.invoke(storeName, "uninstall", new Object[]{configID}, UNINSTALL_SIG);
                    updateStatus("Uninstalled "+configID);

                    doDeploy(deployer, module.getTarget(), false);
                    updateStatus("Deployed "+configID);

                    List list = configurationManager.loadRecursive(configID);
                    for (int j = 0; j < list.size(); j++) {
                        ObjectName name = (ObjectName) list.get(j);
View Full Code Here

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

        String[] childIDs = new String[objectNames.size()-1];
        for (int j=0; j < childIDs.length; j++) {
            childIDs[j] = (String)objectNames.get(j+1);
        }

        TargetModuleIDImpl moduleID = new TargetModuleIDImpl(target, parentName.toString(), childIDs);
        if(isWebApp(kernel, parentName.toString())) {
            moduleID.setType(ModuleType.WAR);
        }
        if(moduleID.getChildTargetModuleID() != null) {
            for (int i = 0; i < moduleID.getChildTargetModuleID().length; i++) {
                TargetModuleIDImpl id = (TargetModuleIDImpl) moduleID.getChildTargetModuleID()[i];
                if(isWebApp(kernel, id.getModuleID())) {
                    id.setType(ModuleType.WAR);
                }
            }
        }
        addModule(moduleID);
        if(finished) {
View Full Code Here

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

                    for (int j = 0; j < list.size(); j++) {
                        ObjectName name = (ObjectName) list.get(j);
                        kernel.startRecursiveGBean(name);
                        String configName = ObjectName.unquote(name.getKeyProperty("name"));
                        List kids = loadChildren(kernel, configName);
                        TargetModuleIDImpl id = new TargetModuleIDImpl(modules[i].getTarget(), configName,
                                (String[]) kids.toArray(new String[kids.size()]));
                        if(isWebApp(kernel, configName)) {
                            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

        String[] childIDs = new String[objectNames.size()-1];
        for (int j=0; j < childIDs.length; j++) {
            childIDs[j] = (String)objectNames.get(j+1);
        }

        TargetModuleIDImpl moduleID = new TargetModuleIDImpl(target, parentName, childIDs);
        if(isWebApp(kernel, parentName)) {
            moduleID.setType(ModuleType.WAR);
        }
        if(moduleID.getChildTargetModuleID() != null) {
            for (int i = 0; i < moduleID.getChildTargetModuleID().length; i++) {
                TargetModuleIDImpl id = (TargetModuleIDImpl) moduleID.getChildTargetModuleID()[i];
                if(isWebApp(kernel, id.getModuleID())) {
                    id.setType(ModuleType.WAR);
                }
            }
        }
        addModule(moduleID);
        if(finished) {
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

                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

     * 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

        String[] childIDs = new String[objectNames.size()-1];
        for (int j=0; j < childIDs.length; j++) {
            childIDs[j] = (String)objectNames.get(j+1);
        }

        TargetModuleIDImpl moduleID = new TargetModuleIDImpl(target, parentName, childIDs);
        if(isWebApp(kernel, parentName)) {
            moduleID.setType(ModuleType.WAR);
        }
        if(moduleID.getChildTargetModuleID() != null) {
            for (int i = 0; i < moduleID.getChildTargetModuleID().length; i++) {
                TargetModuleIDImpl id = (TargetModuleIDImpl) moduleID.getChildTargetModuleID()[i];
                if(isWebApp(kernel, id.getModuleID())) {
                    id.setType(ModuleType.WAR);
                }
            }
        }
        addModule(moduleID);
        if(finished) {
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

                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
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.