/**
* 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 {
http = new InternalHttpServer();
http.addHandler(InternalHttpServer.createLogAppContext());
http.addHandler(InternalHttpServer.createServletContext(
StackServlet.class, "/stacks", "/*", "stacks"));
http.setBindAddress("0.0.0.0");
http.setPort(conf.getNodeStatusPort());
String webAppRoot = FlumeConfiguration.get().getNodeWebappRoot();
http.setWebappDir(new File(webAppRoot));
http.setScanForApps(true);
http.start();