Package org.apache.geronimo.console.util

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


    private void buildEJBModuleContext(Kernel kernel, Map query, TreeEntry node) throws Exception {
        Set beanSet = kernel.listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(null, query));
        for (Object object : beanSet) {
            AbstractName bean = (AbstractName) object;
           
            TreeEntry beanNode = new TreeEntry(bean.getNameProperty("name"), NORMAL_TYPE);
            node.addChild(beanNode);
           
            Map contextMap = (Map) kernel.getAttribute(bean, "componentContextMap");
            for (Object key : contextMap.keySet()) {
                beanNode.addChild(new TreeEntry("java:" + (String)key, NORMAL_TYPE));
            }
        }
    }
View Full Code Here


        Iterator iterator = setEnt.iterator();

        while (iterator.hasNext()) {

            AbstractName gb = (AbstractName) iterator.next();
            TreeEntry webModule = new TreeEntry(gb.getNameProperty("name"), NORMAL_TYPE);

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

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

            TreeEntry servletsNode = null;
            TreeEntry 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 TreeEntry("Servlets", NOT_LEAF_TYPE);
                        webModule.addChild(servletsNode);
                    }
                    if (jspNode == null) {
                        jspNode = new TreeEntry("JSP", NOT_LEAF_TYPE);
                        servletsNode.addChild(jspNode);
                    }
                    jspNode.addChild(new TreeEntry(servlet.substring(4), NORMAL_TYPE));
                } else if (!servlet.equals("jsp")) {
                    if (servletsNode == null) {
                        servletsNode = new TreeEntry("Servlets", NOT_LEAF_TYPE);
                        webModule.addChild(servletsNode);
                    }
                    servletsNode.addChild(new TreeEntry(servlet, NORMAL_TYPE));
                }
            }
           
            Map map = new HashMap();
            map.put("name", "ContextSource");
View Full Code Here

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

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

                    // ignore.... not a context
                }
                if (obj instanceof Context) {
                    buildContextSub(node, (Context) obj, nodeCurr + "/" + pair.getName());
                } else {
                    node.addChild(new TreeEntry(nodeCurr + "/" + pair.getName(), NORMAL_TYPE));
                }
            }
        } catch (Exception e) {
            log.warn("Error listing context", e);
        }
View Full Code Here

                // ignore.... it wasn't a context
            }
            if (obj instanceof Context) {
                buildGlobal(tree, (Context) obj, parent + pair.getName());
            } else {
                tree.addChild(new TreeEntry(parent + pair.getName(), NORMAL_TYPE));
            }
        }
    }
View Full Code Here

        Tree jndiTree = new Tree(null, "name");

        List arryList = new ArrayList();
        Hashtable entApp = new Hashtable();

        TreeEntry treeGlobal = new TreeEntry("Global Context", NOT_LEAF_TYPE);
        jndiTree.addItem(treeGlobal);

        TreeEntry tree = new TreeEntry("Enterprise Applications", NOT_LEAF_TYPE);
        jndiTree.addItem(tree);

        TreeEntry treeMod = new TreeEntry("EJBModule", NOT_LEAF_TYPE);
        entApp.put("EJBModule", treeMod);
        jndiTree.addItem(treeMod);

        treeMod = new TreeEntry("WebModule", NOT_LEAF_TYPE);
        entApp.put("WebModule", treeMod);
        jndiTree.addItem(treeMod);

        treeMod = new TreeEntry("ResourceAdapterModule", NOT_LEAF_TYPE);
        entApp.put("ResourceAdapterModule", treeMod);
        jndiTree.addItem(treeMod);

        treeMod = new TreeEntry("AppClientModule", NOT_LEAF_TYPE);
        entApp.put("AppClientModule", treeMod);
        jndiTree.addItem(treeMod);

        org.apache.geronimo.kernel.Kernel kernel = org.apache.geronimo.kernel.KernelRegistry.getSingleKernel();

        Set setEnt = kernel.listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(null, Collections.EMPTY_MAP,
                org.apache.geronimo.j2ee.management.impl.J2EEApplicationImpl.class.getName()));
        Iterator iterator = setEnt.iterator();
        while (iterator.hasNext()) {
            org.apache.geronimo.gbean.AbstractName gb = (org.apache.geronimo.gbean.AbstractName) iterator.next();
            TreeEntry curr = new TreeEntry(gb.getNameProperty("name"), NORMAL_TYPE);
            tree.addChild(curr);
            entApp.put(gb.getNameProperty("name"), curr);

            TreeEntry temp = new TreeEntry("EJBModule", NOT_LEAF_TYPE);
            curr.addChild(temp);

            temp = new TreeEntry("WebModule", NOT_LEAF_TYPE);
            curr.addChild(temp);

            temp = new TreeEntry("ResourceAdapterModule", NOT_LEAF_TYPE);
            curr.addChild(temp);

            temp = new TreeEntry("AppClientModule", NOT_LEAF_TYPE);
            curr.addChild(temp);
        }
       
        Context globalContext = null;
        Set<AbstractName> names = kernel.listGBeans(new AbstractNameQuery(KernelContextGBean.class.getName()));
View Full Code Here

        for (TreeEntry entry : list) {
            children = entry.getChildren();
            if (children.size() > 0)
                check_no_child(children);
            else if (entry.getType().equals(NOT_LEAF_TYPE))
                children.add(new TreeEntry(NO_CHILD, NORMAL_TYPE));
        }
    }
View Full Code Here

   
    @RemoteMethod
    public Tree getJMXInformation() {
       
        //build "All MBeans" Node
        TreeEntry allMBeansEntry = new TreeEntry("All MBeans");
        allMBeansEntry.addChild(new TreeEntry("geronimo", All_TYPE));
        allMBeansEntry.addChild(new TreeEntry("geronimo.config", All_TYPE));
        //add place holder
        this.addPlaceholder(allMBeansEntry.getChildren());
       
       
        //build "JavaEE MBean" Node
        TreeEntry javaEEMBeansEntry = new TreeEntry("J2EE MBeans");
        javaEEMBeansEntry.addChild(new TreeEntry("AppClientModule", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("EJBModule", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("EntityBean", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("J2EEApplication", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("J2EEDomain", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("J2EEServer", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("JavaMailResource", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("JCAConnectionFactory", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("JCAManagedConnectionFactory", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("JCAResource", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("JDBCDataSource", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("JDBCDriver", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("JDBCResource", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("JMSResource", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("JNDIResource", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("JTAResource", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("JVM", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("MessageDrivenBean", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("PersistenceUnit", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("ResourceAdapter", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("ResourceAdapterModule", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("RMI_IIOPResource", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("Servlet", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("StatefulSessionBean", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("StatelessSessionBean", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("URLResource", JAVAEE_TYPE));
        javaEEMBeansEntry.addChild(new TreeEntry("WebModule", JAVAEE_TYPE));
        //add place holder
        this.addPlaceholder(javaEEMBeansEntry.getChildren());
       
        //build "Geronimo MBean" Node
        TreeEntry geronimoMBeansEntry = new TreeEntry("Geronimo MBeans" );
        geronimoMBeansEntry.addChild(new TreeEntry("AppClient", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("ArtifactManager", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("ArtifactResolver", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("AttributeStore", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("ConfigBuilder", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("ConfigurationEntry", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("ConfigurationManager", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("ConfigurationStore", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("CORBABean", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("CORBACSS", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("CORBATSS", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("Deployer", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("DeploymentConfigurer", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("GBean", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("Host", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("JaasLoginService", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("JACCManager", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("JAXRConnectionFactory", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("JCAActivationSpec", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("JCAAdminObject", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("JCAConnectionManager", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("JCAConnectionTracker", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("JCAResourceAdapter", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("JCAWorkManager", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("JMSConnector", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("JMSPersistence", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("JMSServer", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("KeyGenerator", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("Keystore", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("LoginModule", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("LoginModuleUse", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("MEJB", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("ModuleBuilder", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("PersistentConfigurationList", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("RealmBridge", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("Repository", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("RoleMapper", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("SecurityRealm", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("ServiceModule", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("ServletTemplate", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("ServletWebFilterMapping", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("ServletWebServiceTemplate", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("SystemLog", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("TomcatValve", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("TransactionContextManager", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("TransactionLog", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("TransactionManager", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("URLPattern", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("URLWebFilterMapping", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("WebFilter", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("WSLink", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("XIDFactory", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("XIDImporter", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("XmlAttributeBuilder", GERONIMO_TYPE));
        geronimoMBeansEntry.addChild(new TreeEntry("XmlReferenceBuilder", GERONIMO_TYPE));
        //add place holder
        this.addPlaceholder(geronimoMBeansEntry.getChildren());
           
       
        //build "Geronimo Service Module MBeans" node
        TreeEntry geronimoServiceEntry = new TreeEntry("Geronimo Service Module MBeans" );
        Collection<String> serviceModules = this.getServiceModules();
        Iterator<String> it = serviceModules.iterator();
        while (it.hasNext()){
            String abstractName = it.next();
            geronimoServiceEntry.addChild(new TreeEntry(abstractName, GERONIMO_SERVICE_TYPE));
        }
        //add place holder
        this.addPlaceholder(geronimoServiceEntry.getChildren());
       
       
        //build "Stats Provider MBeans" node
        TreeEntry statsProviderEntry = new TreeEntry("Stats Provider MBeans", STATS_PROVIDER_TYPE);
        this.addPlaceholder(statsProviderEntry);
       
        //build "Search Results" node
        TreeEntry searchNodeEntry = new TreeEntry("Search Results", SEARCHNODE_TYPE);
        this.addPlaceholder(searchNodeEntry);
       
        //build the tree
        Tree tree = new Tree(null, "name");     //id = null means the id will be auto-generated
        tree.addItem(allMBeansEntry);
View Full Code Here

        Container container = null;
        ContainerSystemInfo systemInfo = configuration.containerSystem;
        Map<ContainerType, TreeEntry> containerMap = new TreeMap<ContainerType, TreeEntry>();
        List<ContainerInfo> containerInfos = systemInfo.containers;
        ContainerInfo containerInfo = null;
        TreeEntry containerTypesEntry, containersEntry, deploymentsEntry = null;
        Tree tree = new Tree("name", "name");
        List<TreeEntry> entries = new ArrayList<TreeEntry>();
        for (int i = 0; i < containerInfos.size(); i++) {

            containerInfo = containerInfos.get(i);
            container = containerSystem.getContainer(containerInfo.id);
            List<TreeEntry> containers = null;
            if (containerMap.get(container.getContainerType()) != null) {
                containerTypesEntry = containerMap.get(container.getContainerType());
                containers = containerTypesEntry.getChildren();
            } else {
                containerTypesEntry = new TreeEntry();
                containerTypesEntry.setName(resolveContainerTypes(container.getContainerType()));
                containerTypesEntry.setValues(new String[]{containerTypesEntry.getName()});
                containers = new ArrayList<TreeEntry>();
                containerTypesEntry.setChildren(containers);
                containerMap.put(container.getContainerType(),containerTypesEntry);
                entries.add(containerTypesEntry);
            }
            containersEntry = new TreeEntry();
            containersEntry.setName(containerInfo.id);
            containersEntry.setValues(new String[]{containerInfo.id});

            DeploymentInfo[] deployments = container.deployments();
            containersEntry.setChildren(getDeployments(deployments));
View Full Code Here

TOP

Related Classes of org.apache.geronimo.console.util.TreeEntry

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.