ConfigurationManager configManager = ConfigurationUtil
.getConfigurationManager(kernel);
List infos = configManager.listConfigurations();
for (Iterator infoIterator = infos.iterator(); infoIterator.hasNext();) {
ConfigurationInfo info = (ConfigurationInfo) infoIterator.next();
Configuration conf = configManager.getConfiguration(info
.getConfigID());
if (conf != null) {
StringTree curr = new StringTree(info.getConfigID().toString());
;
switch (info.getType().getValue()) {
case 0:// EAR
{
treeEAR.addChild(curr);
break;
}
case 1:// EJB
{
treeEJB.addChild(curr);
break;
}
case 2:// CAR
{
treeCLI.addChild(curr);
break;
}
case 3:// RAR
{
treeRAR.addChild(curr);
break;
}
case 4:// WAR
{
treeWeb.addChild(curr);
break;
}
case 5:// SERVICE
{
treeSys.addChild(curr);
break;
}
}
addDependencies(curr, conf);
if (info.getType().getValue() == ConfigurationModuleType.EAR
.getValue()) {
StringTree nodeEJB = new StringTree("EJBModule");
curr.addChild(nodeEJB);
StringTree nodeWeb = new StringTree("WebModule");
curr.addChild(nodeWeb);
StringTree nodeRAR = new StringTree("ResourceAdapterModule");
curr.addChild(nodeRAR);
StringTree nodeCLI = new StringTree("AppClientModule");
curr.addChild(nodeCLI);
Map query = new HashMap();
query.put("j2eeType", "EJBModule");
query.put("J2EEApplication", info.getConfigID().toString());
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 subCurr = new StringTree(info.getConfigID()
.getGroupId()
+ "/"
+ info.getConfigID().getArtifactId()
+ "_"
+ gb.getNameProperty("name")
+ "/"
+ info.getConfigID().getVersion()
+ "/"
+ info.getConfigID().getType());
nodeEJB.addChild(subCurr);
addDependencies(subCurr, configManager
.getConfiguration(gb.getArtifact()));
}
Map query1 = new HashMap();
query1.put("j2eeType", "ResourceAdapterModule");
query1
.put("J2EEApplication", info.getConfigID()
.toString());
Set setEnt1 = kernel
.listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
null, query1));
Iterator iterator1 = setEnt1.iterator();
while (iterator1.hasNext()) {
AbstractName gb = (AbstractName) iterator1.next();
StringTree subCurr = new StringTree(info.getConfigID()
.getGroupId()
+ "/"
+ info.getConfigID().getArtifactId()
+ "_"
+ gb.getNameProperty("name")
+ "/"
+ info.getConfigID().getVersion()
+ "/"
+ info.getConfigID().getType());
nodeRAR.addChild(subCurr);
addDependencies(subCurr, configManager
.getConfiguration(gb.getArtifact()));
}