public void getApplicationStatusForHosts(NSArray<MHost> hostArray) {
WOResponse[] responses = sendQueryToWotaskds("APPLICATION", hostArray);
NSMutableArray errorArray = new NSMutableArray();
NSDictionary applicationResponseDictionary;
NSDictionary queryResponseDictionary;
NSArray responseArray = null;
NSDictionary responseDictionary = null;
for (int i = 0; i < responses.length; i++) {
if ((responses[i] == null) || (responses[i].content() == null)) {
queryResponseDictionary = emptyResponse;
} else {
try {
queryResponseDictionary = (NSDictionary) new _JavaMonitorDecoder().decodeRootObject(responses[i]
.content());
} catch (WOXMLException wxe) {
NSLog.err.appendln("MonitorComponent pageWithName(ApplicationsPage) Error decoding response: "
+ responses[i].contentString());
queryResponseDictionary = responseParsingFailed;
}
}
getGlobalErrorFromResponse(queryResponseDictionary, errorArray);
applicationResponseDictionary = (NSDictionary) queryResponseDictionary.valueForKey("queryWotaskdResponse");
if (applicationResponseDictionary != null) {
responseArray = (NSArray) applicationResponseDictionary.valueForKey("applicationResponse");
if (responseArray != null) {
for (int j = 0; j < responseArray.count(); j++) {
responseDictionary = (NSDictionary) responseArray.objectAtIndex(j);
String appName = (String) responseDictionary.valueForKey("name");
Integer runningInstances = (Integer) responseDictionary.valueForKey("runningInstances");
MApplication anApplication = siteConfig().applicationWithName(appName);
if (anApplication != null) {
anApplication.setRunningInstancesCount(anApplication.runningInstancesCount() + runningInstances.intValue());
}
}