@Override public void activateOptions() { super.activateOptions(); if (Ignitor.isIgnited()) return; try { final XMLConfigurator xmlCofig = XmlConfiguratorLoader.loadForPureJavaProgram(); if (xmlCofig == null) throw new IgnitionFailureException( "cannot find Configuration:[" + XmlConfiguratorLoader.ZMONITOR_XML + "] from current application context: " + this.getClass()); isIgnitBySelf = Ignitor.ignite(new ThreadLocalTimelineLifecycleManager(), xmlCofig); ZMLog.info(">> Ignit ZMonitor in: ", ZMonitorAppender.class.getCanonicalName()); } catch (IOException e) { throw new IgnitionFailureException(e); } }
public void close() { if (isIgnitBySelf) { Ignitor.destroy(); } }