protected void startPlugins() { if (plugins != null) { for (int i = 0; i < plugins.size(); i++) { EtmPlugin etmPlugin = (EtmPlugin) plugins.get(i); try { etmPlugin.init(new EtmMonitorSupportContext(this, scheduler)); etmPlugin.start(); if (etmPlugin instanceof EtmMonitorListener) { dispatcher.register((EtmMonitorListener) etmPlugin); } } catch (Exception e) { log.warn("Error starting plugin " + etmPlugin.getPluginMetaData() + ". Keep plugin disabled. ", e); } } } }
public void start() { if (started) { collecting = true; return; } scheduler = new Timer(true); if (dispatcher == null) { dispatcher = new DefaultEventDispatcher(); } dispatcher.register(this); // 1. start plugins startPlugins(); // 2. init aggregators aggregator.init(new EtmMonitorSupportContext(this, scheduler)); // 3. start aggregators aggregator.start(); started = true; collecting = true; log.info("JETM " + Version.getVersion() + " started."); }
public void start() { if (started) { collecting = true; return; } scheduler = new Timer(true); if (dispatcher == null) { dispatcher = new DefaultEventDispatcher(); } dispatcher.register(this); // 1. start plugins startPlugins(); // 2. init aggregators aggregator.init(new EtmMonitorSupportContext(this, scheduler)); // 3. start aggregators aggregator.start(); started = true; collecting = true; LOG.info("JETM " + Version.getVersion() + " started."); }
private void startPlugin(EtmPlugin aEtmPlugin) { try { aEtmPlugin.init(new EtmMonitorSupportContext(this, scheduler)); if (aEtmPlugin instanceof EtmMonitorListener) { dispatcher.register((EtmMonitorListener) aEtmPlugin); } aEtmPlugin.start(); } catch (Exception e) { LOG.warn("Error starting plugin " + aEtmPlugin.getPluginMetaData() + ". Keep plugin disabled. ", e); } }