failed.put(name, buf.toString());
continue;
}
// Check if this is ServerInfo
GBeanInfo info = kernel.getGBeanInfo(name);
if (info.getClassName().equals("org.apache.geronimo.system.serverinfo.ServerInfo")) {
serverInfo = (String) kernel.getAttribute(name, "version");
}
// Look for any SocketAddress properties
List list = (List) beanInfos.get(info);
if (list == null) {
list = new ArrayList(3);
beanInfos.put(info, list);
Set atts = info.getAttributes();
for (Iterator it2 = atts.iterator(); it2.hasNext();) {
GAttributeInfo att = (GAttributeInfo) it2.next();
if (att.getType().equals("java.net.InetSocketAddress")) {
list.add(att);
}
}
}
for (int i = 0; i < list.size(); i++) {
GAttributeInfo att = (GAttributeInfo) list.get(i);
try {
InetSocketAddress addr = (InetSocketAddress) kernel.getAttribute(name, att.getName());
if (addr == null) {
log.debug("No value for GBean " + name + " attribute " + att.getName());
continue;
} else if (addr.getAddress() == null || addr.getAddress().getHostAddress() == null) {
log.debug("Null address or host for GBean " + name + " " + att.getName() + ": " + addr.getAddress());
}
String attName = info.getName();
if (list.size() > 1) {
attName += " " + decamelize(att.getName());
} else if (info.getAttribute("name") != null) {
attName += " " + kernel.getAttribute(name, "name");
}
ports.add(new AddressHolder(attName, addr));
} catch (IllegalStateException e) {
// We weren't able to load a port for this service -- that's a bummer