public WOActionResults infoAction() {
ERXResponse woresponse = new ERXResponse();
String result = "";
for (Enumeration enumeration = instances.objectEnumerator(); enumeration.hasMoreElements();) {
MInstance minstance = (MInstance) enumeration.nextElement();
result += (result.length() == 0 ? "" : ", \n");
result += "{";
result += "\"name\": \"" + minstance.applicationName() + "\", ";
result += "\"id\": \"" + minstance.id() + "\", ";
result += "\"host\": \"" + minstance.hostName() + "\", ";
result += "\"port\": \"" + minstance.port() + "\", ";
result += "\"state\": \"" + MObject.stateArray[minstance.state] + "\", ";
result += "\"deaths\": \"" + minstance.deathCount() + "\", ";
result += "\"refusingNewSessions\": " + minstance.isRefusingNewSessions() + ", ";
result += "\"scheduled\": " + minstance.isScheduled() + ", ";
result += "\"schedulingHourlyStartTime\": " + minstance.schedulingHourlyStartTime() + ", ";
result += "\"schedulingDailyStartTime\": " + minstance.schedulingDailyStartTime() + ", ";
result += "\"schedulingWeeklyStartTime\": " + minstance.schedulingWeeklyStartTime() + ", ";
result += "\"schedulingType\": \"" + minstance.schedulingType() + "\", ";
result += "\"schedulingStartDay\": " + minstance.schedulingStartDay() + ", ";
result += "\"schedulingInterval\": " + minstance.schedulingInterval() + ", ";
result += "\"transactions\": \"" + minstance.transactions() + "\", ";
result += "\"activeSessions\": \"" + minstance.activeSessions() + "\", ";
result += "\"averageIdlePeriod\": \"" + minstance.averageIdlePeriod() + "\", ";
result += "\"avgTransactionTime\": \"" + minstance.avgTransactionTime() + "\",";
result += "\"autoRecover\": \"" + minstance.isAutoRecovering() + "\"";
String infoMode = (String) context().request().formValueForKey("info");
if ("full".equalsIgnoreCase(infoMode)) {
result += ", \"additionalArgs\": \"";
if (minstance.additionalArgs() != null) {
result += minstance.additionalArgs().replace("\"", "\\\"");
}
result += "\"";
}
result += "}";
}