use of org.eclipse.jetty.monitor.triggers.AggregateEventTrigger in project jetty.project by eclipse.
the class JavaMonitorAction method parseResponse.
/* ------------------------------------------------------------ */
private void parseResponse(Properties response) {
if (response.get("onhold") != null)
throw new Error("Suspended");
if (response.get("session") != null) {
_session = (String) response.remove("session");
AggregateEventTrigger trigger = (AggregateEventTrigger) getTrigger();
String queryString;
ObjectName[] queryResults;
for (Map.Entry<Object, Object> entry : response.entrySet()) {
String[] values = ((String) entry.getValue()).split("\\|");
queryString = values[0];
if (queryString.startsWith("com.javamonitor.openfire"))
continue;
if (queryString.startsWith("com.javamonitor")) {
queryString = "org.eclipse.jetty.monitor.integration:type=javamonitortools,id=0";
}
queryResults = null;
try {
queryResults = queryNames(queryString);
} catch (IOException e) {
LOG.debug(e);
} catch (MalformedObjectNameException e) {
LOG.debug(e);
}
if (queryResults != null) {
int idx = 0;
for (ObjectName objName : queryResults) {
String id = entry.getKey().toString() + (idx == 0 ? "" : ":" + idx);
String name = queryString.equals(objName.toString()) ? "" : objName.toString();
boolean repeat = Boolean.parseBoolean(values[2]);
trigger.add(new JavaMonitorTrigger(objName, values[1], id, name, repeat));
}
}
}
}
}
Aggregations