/**
* This also implements the Apache Commons Daemon interface's start
*/
synchronized public void start() {
FlumeConfiguration conf = FlumeConfiguration.get();
// the simple report interface
simpleReportManager.add(vmInfo);
simpleReportManager.add(sysInfo);
simpleReportManager.add(new Reportable() {
@Override
public String getName() {
return FlumeNode.this.getName();
}
@Override
public ReportEvent getMetrics() {
return FlumeNode.this.getReport();
}
@Override
public Map<String, Reportable> getSubMetrics() {
return ReportUtil.noChildren();
}
});
// the full report interface
ReportManager.get().add(vmInfo);
ReportManager.get().add(sysInfo);
ReportManager.get().add(this);
if (startHttp) {
try {
String webPath = getWebPath(conf);
boolean findport = FlumeConfiguration.get().getNodeAutofindHttpPort();
this.http = new StatusHttpServer("flumeagent", webPath, "0.0.0.0", conf
.getNodeStatusPort(), findport);
http.addServlet(jerseyNodeServlet(), "/node/*");
http.start();
} catch (IOException e) {
LOG.error("Flume node failed: " + e.getMessage(), e);