private void doList(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException {
WebManager[] managers = PortletManager.getWebManagers(renderRequest);
List<ContainerInfo> all = new ArrayList<ContainerInfo>();
for (int i = 0; i < managers.length; i++) {
WebManager manager = managers[i];
AbstractName webManagerName = PortletManager.getNameFor(renderRequest, manager);
WebContainer[] containers = (WebContainer[]) manager.getContainers();
for (int j = 0; j < containers.length; j++) {
List<ConnectorInfo> beans = new ArrayList<ConnectorInfo>();
WebContainer container = containers[j];
AbstractName containerName = PortletManager.getNameFor(renderRequest, container);
String id;
if(containers.length == 1) {
id = manager.getProductName();
} else {
id = manager.getProductName() + " (" + containerName.getName().get(NameFactory.J2EE_NAME) + ")";
}
ContainerInfo result = new ContainerInfo(id, webManagerName.toString(), containerName.toString());
for (NetworkConnector connector : manager.getConnectorsForContainer(container)) {
ConnectorInfo info = new ConnectorInfo();
AbstractName connectorName = PortletManager.getNameFor(renderRequest, connector);
info.setConnectorURI(connectorName.toString());
info.setDescription(PortletManager.getGBeanDescription(renderRequest, connectorName));
info.setUniqueName((String)connectorName.getName().get(NameFactory.J2EE_NAME));
info.setState(((GeronimoManagedBean)connector).getState());
info.setPort(connector.getPort());
try {
info.setProtocol(connector.getProtocol());
} catch (IllegalStateException e) {
info.setProtocol("unknown");
}
beans.add(info);
}
result.setConnectors(beans);
result.setConnectorTypes(manager.getConnectorTypes());
all.add(result);
}
}
if (0 == all.size()) {
addWarningMessage(renderRequest, "warnMsg08");