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});
BeanContext[] deployments = container.getBeanContexts();
containersEntry.setChildren(getDeployments(deployments));