@Test public void testSetConfiguration() throws Throwable { MacroFilter macroFilter = new MacroFilter(); Configuration cfg = new SimpleConfiguration(); macroFilter.setConfiguration(cfg); assertNotNull(macroFilter.seq, "macroFilter.seq"); assertSame(cfg, macroFilter.cfg, "macroFilter.cfg"); assertEquals(0, macroFilter.unsetFields.length, "macroFilter.unsetFields.length"); assertEquals(0, macroFilter.validFields.length, "macroFilter.validFields.length"); }
public void setConfiguration (Configuration cfg) throws ConfigurationException { this.cfg = cfg; try { String seqName = cfg.get ("sequencer", null); unsetFields = ISOUtil.toStringArray(cfg.get ("unset", "")); validFields = ISOUtil.toStringArray(cfg.get ("valid", "")); if (seqName != null) { seq = NameRegistrar.get ( "sequencer."+cfg.get("sequencer") ); } else if (seq == null) { seq = new VolatileSequencer(); } } catch (NameRegistrar.NotFoundException e) { throw new ConfigurationException (e); } }
MacroFilter implements ISOFilter, Configurable { public void setConfiguration (Configuration cfg) throws ConfigurationException { this.cfg = cfg; try { String seqName = cfg.get ("sequencer", null); unsetFields = ISOUtil.toStringArray(cfg.get ("unset", "")); validFields = ISOUtil.toStringArray(cfg.get ("valid", "")); if (seqName != null) { seq = NameRegistrar.get ( "sequencer."+cfg.get("sequencer") ); } else if (seq == null) { seq = new VolatileSequencer(); } } catch (NameRegistrar.NotFoundException e) { throw new ConfigurationException (e); } } }
MacroFilter implements ISOFilter, Configurable { public void setConfiguration (Configuration cfg) throws ConfigurationException { this.cfg = cfg; try { String seqName = cfg.get ("sequencer", null); unsetFields = ISOUtil.toStringArray(cfg.get ("unset", "")); validFields = ISOUtil.toStringArray(cfg.get ("valid", "")); if (seqName != null) { seq = NameRegistrar.get ( "sequencer."+cfg.get("sequencer") ); } else if (seq == null) { seq = new VolatileSequencer(); } } catch (NameRegistrar.NotFoundException e) { throw new ConfigurationException (e); } } MacroFilter(); }
MacroFilter implements ISOFilter, Configurable { public void setConfiguration (Configuration cfg) throws ConfigurationException { this.cfg = cfg; try { String seqName = cfg.get ("sequencer", null); unsetFields = ISOUtil.toStringArray(cfg.get ("unset", "")); validFields = ISOUtil.toStringArray(cfg.get ("valid", "")); if (seqName != null) { seq = NameRegistrar.get ( "sequencer."+cfg.get("sequencer") ); } else if (seq == null) { seq = new VolatileSequencer(); } } catch (NameRegistrar.NotFoundException e) { throw new ConfigurationException (e); } } MacroFilter(); void setConfiguration(Configuration cfg); ISOMsg filter(ISOChannel channel, ISOMsg m, LogEvent evt); }
MacroFilter implements ISOFilter, Configurable { public void setConfiguration (Configuration cfg) throws ConfigurationException { this.cfg = cfg; try { String seqName = cfg.get ("sequencer", null); unsetFields = ISOUtil.toStringArray(cfg.get ("unset", "")); validFields = ISOUtil.toStringArray(cfg.get ("valid", "")); if (seqName != null) { seq = NameRegistrar.get ( "sequencer."+cfg.get("sequencer") ); } else if (seq == null) { seq = new VolatileSequencer(); } } catch (NameRegistrar.NotFoundException e) { throw new ConfigurationException (e); } } MacroFilter(); void setConfiguration(Configuration cfg); ISOMsg filter(ISOChannel channel, ISOMsg m, LogEvent evt);  }