1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| ObjectName[] serverRT = (ObjectName[]) connection.getAttribute(service, "ServerRuntimes");
int length = (int) serverRT.length;
for (int i = 0; i < length; i++) {
ObjectName[] appRT = (ObjectName[]) connection.getAttribute(serverRT[i], "ApplicationRuntimes");
int appLength = (int) appRT.length;
for (int x = 0; x < appLength; x++) {
ObjectName[] compRT = (ObjectName[]) connection.getAttribute(appRT[x], "ComponentRuntimes");
int compLength = (int) compRT.length;
boolean appNameDisplayed = false;
for (int y = 0; y < compLength; y++) {
String componentType = (String) connection.getAttribute(compRT[y], "Type");
if (componentType.toString().equals("WebAppComponentRuntime")){
if(!appNameDisplayed) {
out.print((String)connection.getAttribute(appRT[x], "Name") + "<br />");
appNameDisplayed = true;
}
out.print(" - " + (String)connection.getAttribute(compRT[y], "Name") + "<br />");
ObjectName[] sessionsRT = (ObjectName[]) connection.getAttribute(compRT[y], "ServletSessions");
int sessionsLength = sessionsRT.length;
for (int z = 0; z < sessionsLength; z++) {
out.print(" - " + (String)connection.getAttribute(sessionsRT[z], "Name") + "<br />");
}
}
}
}
} |
Partager