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");