Examples of StringTree


Examples of org.apache.geronimo.console.util.StringTree

            return "[]";

        StringBuffer stb = new StringBuffer();
        stb.append("[");
        for (int i = 0; i < list.size(); i++) {
            StringTree node = (StringTree) list.get(i);
            if (i != 0)
                stb.append(",");
            stb.append(node.toJSONObject("" + i));
        }
        stb.append("]");
        return stb.toString();
    }
View Full Code Here

Examples of org.apache.geronimo.console.util.StringTree

        Set setEnt = kernel.listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(null, query));
        Iterator iterator = setEnt.iterator();

        while (iterator.hasNext()) {
            AbstractName gb = (AbstractName) iterator.next();
            StringTree ejbModule = new StringTree(gb.getNameProperty("name"));

            if (gb.getNameProperty("J2EEApplication") == null
                    || gb.getNameProperty("J2EEApplication").equals("null")) {
                StringTree treeEnt = (StringTree) entApp.get("EJBModule");
                treeEnt.addChild(ejbModule);
            } else {
                StringTree treeEnt = (StringTree) entApp.get(gb
                        .getNameProperty("J2EEApplication"));
                treeEnt = treeEnt.findNode("EJBModule");
                treeEnt.addChild(ejbModule);
            }
            Map queryEnt = new HashMap();
            StringTree entityBean = new StringTree("EntityBeans");
            ejbModule.addChild(entityBean);
            queryEnt.put("j2eeType", "EntityBean");
            queryEnt.put("EJBModule", gb.getNameProperty("name"));
            queryEnt.put("J2EEApplication", gb
                    .getNameProperty("J2EEApplication"));
            Set setEntBean = kernel
                    .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
                            null, queryEnt));

            Iterator iterEntBean = setEntBean.iterator();

            while (iterEntBean.hasNext()) {
                AbstractName gbEntBean = (AbstractName) iterEntBean.next();
                StringTree beanNode = new StringTree(gbEntBean
                        .getNameProperty("name"));
                entityBean.addChild(beanNode);
                Context jndi = (Context) kernel.getAttribute(gbEntBean,
                        "componentContext");
                buildContext(beanNode, jndi, "java:comp");
            }

            queryEnt = new HashMap();
            StringTree sessionBean = new StringTree("SessionBeans");
            ejbModule.addChild(sessionBean);
            queryEnt.put("j2eeType", "StatelessSessionBean");
            queryEnt.put("EJBModule", gb.getNameProperty("name"));
            queryEnt.put("J2EEApplication", gb
                    .getNameProperty("J2EEApplication"));
            Set setSessionBean = kernel
                    .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
                            null, queryEnt));

            Iterator iterSessionBean = setSessionBean.iterator();

            while (iterSessionBean.hasNext()) {
                AbstractName gbSessionBean = (AbstractName) iterSessionBean
                        .next();
                StringTree beanNode = new StringTree(gbSessionBean
                        .getNameProperty("name"));
                sessionBean.addChild(beanNode);
                Context jndi = (Context) kernel.getAttribute(gbSessionBean,
                        "componentContext");
                buildContext(beanNode, jndi, "java:comp");
            }

            queryEnt = new HashMap();
            queryEnt.put("j2eeType", "StatefullSessionBean");
            queryEnt.put("EJBModule", gb.getNameProperty("name"));
            queryEnt.put("J2EEApplication", gb
                    .getNameProperty("J2EEApplication"));
            setSessionBean = kernel
                    .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
                            null, queryEnt));

            iterSessionBean = setSessionBean.iterator();

            while (iterSessionBean.hasNext()) {
                AbstractName gbSessionBean = (AbstractName) iterSessionBean
                        .next();
                StringTree beanNode = new StringTree(gbSessionBean
                        .getNameProperty("name"));
                sessionBean.addChild(beanNode);
                Context jndi = (Context) kernel.getAttribute(gbSessionBean,
                        "componentContext");
                buildContext(beanNode, jndi, "java:comp");
View Full Code Here

Examples of org.apache.geronimo.console.util.StringTree

        Iterator iterator = setEnt.iterator();

        while (iterator.hasNext()) {

            AbstractName gb = (AbstractName) iterator.next();
            StringTree webModule = new StringTree(gb.getNameProperty("name"));

            if (gb.getNameProperty("J2EEApplication") == null
                    || gb.getNameProperty("J2EEApplication").equals("null")) {
                StringTree treeEnt = (StringTree) entApp.get("WebModule");
                treeEnt.addChild(webModule);
            } else {
                StringTree treeEnt = (StringTree) entApp.get(gb
                        .getNameProperty("J2EEApplication"));
                treeEnt = treeEnt.findNode("WebModule");
                treeEnt.addChild(webModule);
            }

            Map map = (Map) kernel.getAttribute(gb, "componentContext");
            String[] servlets = (String[]) kernel.getAttribute(gb, "servlets");

            StringTree servletsNode = null;
            StringTree jspNode = null;

            for (int i = 0; i < servlets.length; i++) {
                String servlet = servlets[i];
                servlet = servlet.substring(servlet.indexOf("name=") + 5);
                if (servlet.indexOf(",") != -1)
                    servlet = servlet.substring(0, servlet.indexOf(","));
                if (!servlet.equals("jsp") && servlet.startsWith("jsp.")) {
                    if (servletsNode == null) {
                        servletsNode = new StringTree("Servlets");
                        webModule.addChild(servletsNode);
                    }
                    if (jspNode == null) {
                        jspNode = new StringTree("JSP");
                        servletsNode.addChild(jspNode);
                    }
                    jspNode.addChild(new StringTree(servlet.substring(4)));
                } else if (!servlet.equals("jsp")) {
                    if (servletsNode == null) {
                        servletsNode = new StringTree("Servlets");
                        webModule.addChild(servletsNode);
                    }
                    servletsNode.addChild(new StringTree(servlet));
                }
            }
            Iterator contexts = map.keySet().iterator();
            while (contexts.hasNext())
                webModule.addChild(new StringTree("java:comp/" + contexts.next()));
        }
    }
View Full Code Here

Examples of org.apache.geronimo.console.util.StringTree

        while (iterator.hasNext()) {
            AbstractName gb = (AbstractName) iterator.next();
            String resourceModule = gb.getNameProperty("name");
            if (gb.getNameProperty("J2EEApplication") == null
                    || gb.getNameProperty("J2EEApplication").equals("null")) {
                StringTree treeEnt = (StringTree) entApp
                        .get("ResourceAdapterModule");
                treeEnt.addChild(new StringTree(resourceModule));
            } else {
                StringTree treeEnt = (StringTree) entApp.get(gb
                        .getNameProperty("J2EEApplication"));
                treeEnt = treeEnt.findNode("ResourceAdapterModule");
                treeEnt.addChild(new StringTree(resourceModule));
            }
        }
    }
View Full Code Here

Examples of org.apache.geronimo.console.util.StringTree

        while (iterator.hasNext()) {
            AbstractName gb = (AbstractName) iterator.next();
            String appClienteModule = gb.getNameProperty("name");
            if (gb.getNameProperty("J2EEApplication") == null
                    || gb.getNameProperty("J2EEApplication").equals("null")) {
                StringTree treeEnt = (StringTree) entApp.get("AppClientModule");
                treeEnt.addChild(new StringTree(appClienteModule));
            } else {
                StringTree treeEnt = (StringTree) entApp.get(gb
                        .getNameProperty("J2EEApplication"));
                treeEnt = treeEnt.findNode("AppClientModule");
                treeEnt.addChild(new StringTree(appClienteModule));
            }
        }
    }
View Full Code Here

Examples of org.apache.geronimo.console.util.StringTree

                Object obj = ctx.lookup(pair.getName());
                if (obj instanceof Context) {
                    buildContextSub(node, (Context) obj, nodeCurr + "/"
                            + pair.getName());
                } else {
                    node.addChild(new StringTree(nodeCurr + "/" + pair.getName()));
                }
            }
        } catch (Exception e) {
            log.warn("Error listing context", e);
        }
View Full Code Here

Examples of org.data2semantics.RDFmodel.StringTree

  public List<Integer> partition() {
    URIDistinguisher D = new URIDistinguisher(_boundary, _ST);
    IndexMap<StringTree> map = new IndexMap<StringTree>();
    List<List<String>> res = new ArrayList<List<String>>();
    for (String uristr : _uris) {
      StringTree st = D.get_node(uristr);
      int cell = map.map(st);
      if (cell == res.size()) res.add(new ArrayList<String>());
      res.get(cell).add(uristr);
    }
    List<Integer> sizes = new ArrayList<Integer>();
View Full Code Here

Examples of org.data2semantics.RDFmodel.StringTree

 
  @Main public void main() {
    _uris = new ArrayList<String>();
    _lits = new ArrayList<Literal>();
    _G = new RDFGraph(new RDFGraph.TripleFile(_fn)); // FIXME: URIs uninitialized!
    _ST = new StringTree(_uris);
    Pair<Boundary,Set<Integer>> pair = findBoundaryAndTBox(_G, _uris, _ST);
    _boundary = pair.getLeft();
    _tbox = pair.getRight();
  }
View Full Code Here

Examples of org.data2semantics.RDFmodel.StringTree

  @Main
  public void main() {
    _uris = new ArrayList<String>();
    _lits = new ArrayList<Literal>();
    _G = new RDFGraph(new RDFGraph.TripleFile(_fn)); // FIXME: URIs uninitialized!
    _ST = new StringTree(_uris);
    _tbox = tbox_heuristic_most_incoming(_G, _minlinks);
    _boundary = findBestBoundary(_G, _uris, _tbox, _ST);
    codelengths();
  }
View Full Code Here

Examples of org.gedcom4j.model.StringTree

     */
    private static StringTree findLast(StringTree tree, int level) {
        if (tree.level == level) {
            return tree;
        }
        StringTree lastChild = tree.children.get(tree.children.size() - 1);
        if (lastChild.level == level) {
            return lastChild;
        }
        return findLast(lastChild, level);
    }
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.