sourcesExecutor.execute((Runnable) sources[i]);
}
}
private static void setupBackplane() {
final Reporter reporter = Reporter.getReporter();
/* Sync the reporter every n seconds */
String syncIntervalStr = System.getProperty("xtrace.proxy.syncinterval", "5");
long syncInterval = Integer.parseInt(syncIntervalStr);
Timer timer = new Timer();
timer.schedule(new SyncTimer(reporter), syncInterval*1000, syncInterval*1000);
new Thread(new Runnable() {
public void run() {
LOG.info("Proxy waiting for reports");
while (true) {
String msg = null;
try {
msg = incomingReportQueue.take();
} catch (InterruptedException e) {
LOG.warn("Interrupted", e);
continue;
}
LOG.debug("Received report of length " + msg.length());
LOG.debug(msg);
Report rpt = Report.createFromString(msg);
reporter.sendReport(rpt);
LOG.debug("Report sent to backend");
}
}
}).start();
}