Package org.apache.geronimo.deployment.plugin

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


                    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

        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

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

                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

     * 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

        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

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

                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

     * 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

TOP

Related Classes of org.apache.geronimo.deployment.plugin.TargetModuleIDImpl

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.