Set setEnt = kernel.listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(null, query));
Iterator iterator = setEnt.iterator();
while (iterator.hasNext()) {
AbstractName gb = (AbstractName) iterator.next();
TreeEntry ejbModule = new TreeEntry(gb.getNameProperty("name"), NORMAL_TYPE);
if (gb.getNameProperty("J2EEApplication") == null || gb.getNameProperty("J2EEApplication").equals("null")) {
TreeEntry treeEnt = (TreeEntry) entApp.get("EJBModule");
treeEnt.addChild(ejbModule);
} else {
TreeEntry treeEnt = (TreeEntry) entApp.get(gb.getNameProperty("J2EEApplication"));
treeEnt = treeEnt.findEntry("EJBModule");
treeEnt.addChild(ejbModule);
}
Map queryEnt = new HashMap();
TreeEntry entityBean = new TreeEntry("EntityBeans", NOT_LEAF_TYPE);
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();
TreeEntry beanNode = new TreeEntry(gbEntBean.getNameProperty("name"), NORMAL_TYPE);
entityBean.addChild(beanNode);
Context jndi = (Context) kernel.getAttribute(gbEntBean, "componentContext");
buildContext(beanNode, jndi, "java:comp");
}
queryEnt = new HashMap();
TreeEntry sessionBean = new TreeEntry("SessionBeans", NOT_LEAF_TYPE);
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();
TreeEntry beanNode = new TreeEntry(gbSessionBean.getNameProperty("name"), NORMAL_TYPE);
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();
TreeEntry beanNode = new TreeEntry(gbSessionBean.getNameProperty("name"),NORMAL_TYPE);
sessionBean.addChild(beanNode);
Context jndi = (Context) kernel.getAttribute(gbSessionBean, "componentContext");
buildContext(beanNode, jndi, "java:comp");
}
}