public final void doConfigure(final InputSource inputSource) throws JoranException { long threshold = System.currentTimeMillis(); if (!ConfigurationWatchListUtil.wasConfigurationWatchListReset(context)) { informContextOfURLUsedForConfiguration(getContext(), null); } SaxEventRecorder recorder = new SaxEventRecorder(context); recorder.recordEvents(inputSource); doConfigure(recorder.saxEventList); // no exceptions a this level StatusUtil statusUtil = new StatusUtil(context); if (statusUtil.noXMLParsingErrorsOccurred(threshold)) { addInfo("Registering current configuration as safe fallback point"); registerSafeConfiguration(); } }
@Override public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { SaxEventRecorder recorder = new SaxEventRecorder(context); this.attributeInUse = null; this.optional = OptionHelper.toBoolean(attributes.getValue(OPTIONAL_ATTR), false); if (!checkAttributes(attributes)) { return; } InputStream in = getInputStream(ec, attributes); try { if (in != null) { parseAndRecord(in, recorder); // remove the <included> tag from the beginning and </included> from the end trimHeadAndTail(recorder); // offset = 2, because we need to get past this element as well as the end element ec.getJoranInterpreter().getEventPlayer().addEventsDynamically(recorder.saxEventList, 2); } } catch (JoranException e) { addError("Error while parsing " + attributeInUse, e); } finally { close(in); } }
/** * Creates a SAX event recorder based on given parameters. Subclasses * should override this as necessary. * @param in input stream * @param url URL to opened file/resource * @return the newly created recorder */ protected SaxEventRecorder createRecorder(InputStream in, URL url) { return new SaxEventRecorder(getContext()); }
/** * Creates a {@link SaxEventRecorder} based on the input stream * @return the newly created recorder */ @Override protected SaxEventRecorder createRecorder(InputStream in, URL url) { return new SaxEventRecorder(getContext()); } }
public List<SaxEvent> doTest(String filename) throws Exception { SaxEventRecorder recorder = new SaxEventRecorder(context); FileInputStream fis = new FileInputStream(CoreTestConstants.TEST_DIR_PREFIX + "input/joran/"+ filename); recorder.recordEvents(fis); return recorder.getSaxEventList(); }
final public void doConfigure(final InputSource inputSource) throws JoranException { SaxEventRecorder recorder = new SaxEventRecorder(); recorder.setContext(context); recorder.recordEvents(inputSource); buildInterpreter(); // disallow simultaneous configurations of the same context synchronized (context.getConfigurationLock()) { interpreter.play(recorder.saxEventList); } }
public final void doConfigure(final InputSource inputSource) throws JoranException { long threshold = System.currentTimeMillis(); // if (!ConfigurationWatchListUtil.wasConfigurationWatchListReset(context)) { // informContextOfURLUsedForConfiguration(getContext(), null); // } SaxEventRecorder recorder = new SaxEventRecorder(context); recorder.recordEvents(inputSource); doConfigure(recorder.saxEventList); // no exceptions a this level StatusUtil statusUtil = new StatusUtil(context); if (statusUtil.noXMLParsingErrorsOccurred(threshold)) { addInfo("Registering current configuration as safe fallback point"); registerSafeConfiguration(recorder.saxEventList); } }
public final void doConfigure(final InputSource inputSource) throws JoranException { long threshold = System.currentTimeMillis(); // if (!ConfigurationWatchListUtil.wasConfigurationWatchListReset(context)) { // informContextOfURLUsedForConfiguration(getContext(), null); // } SaxEventRecorder recorder = new SaxEventRecorder(context); recorder.recordEvents(inputSource); doConfigure(recorder.saxEventList); // no exceptions a this level StatusUtil statusUtil = new StatusUtil(context); if (statusUtil.noXMLParsingErrorsOccurred(threshold)) { addInfo("Registering current configuration as safe fallback point"); registerSafeConfiguration(recorder.saxEventList); } }
public final void doConfigure(final InputSource inputSource) throws JoranException { long threshold = System.currentTimeMillis(); // if (!ConfigurationWatchListUtil.wasConfigurationWatchListReset(context)) { // informContextOfURLUsedForConfiguration(getContext(), null); // } SaxEventRecorder recorder = new SaxEventRecorder(context); recorder.recordEvents(inputSource); doConfigure(recorder.saxEventList); // no exceptions a this level StatusUtil statusUtil = new StatusUtil(context); if (statusUtil.noXMLParsingErrorsOccurred(threshold)) { addInfo("Registering current configuration as safe fallback point"); registerSafeConfiguration(recorder.saxEventList); } }
public final void doConfigure(final InputSource inputSource) throws JoranException { long threshold = System.currentTimeMillis(); if (!ConfigurationWatchListUtil.wasConfigurationWatchListReset(context)) { informContextOfURLUsedForConfiguration(getContext(), null); } SaxEventRecorder recorder = new SaxEventRecorder(context); recorder.recordEvents(inputSource); doConfigure(recorder.saxEventList); // no exceptions a this level StatusUtil statusUtil = new StatusUtil(context); if (statusUtil.noXMLParsingErrorsOccurred(threshold)) { addInfo("Registering current configuration as safe fallback point"); registerSafeConfiguration(); } }
/** * Configures logback with the configuration XML read from an input source. * * @param inputSource the input source, containing the configuration XML * @throws JoranException */ private final void doConfigure(final InputSource inputSource) throws JoranException { long threshold = System.currentTimeMillis(); // if (!ConfigurationWatchListUtil.wasConfigurationWatchListReset(context)) { // informContextOfURLUsedForConfiguration(getContext(), null); // } SaxEventRecorder recorder = new SaxEventRecorder(context); recorder.recordEvents(inputSource); doConfigure(recorder.getSaxEventList()); // no exceptions a this level StatusUtil statusUtil = new StatusUtil(context); if (statusUtil.noXMLParsingErrorsOccurred(threshold)) { addInfo("Registering current configuration as safe fallback point"); registerSafeConfiguration(recorder.getSaxEventList()); } }
public final void doConfigure(final InputSource inputSource) throws JoranException { long threshold = System.currentTimeMillis(); if (!ConfigurationWatchListUtil.wasConfigurationWatchListReset(context)) { informContextOfURLUsedForConfiguration(getContext(), null); } SaxEventRecorder recorder = new SaxEventRecorder(); recorder.setContext(context); recorder.recordEvents(inputSource); doConfigure(recorder.saxEventList); // no exceptions a this level StatusChecker statusChecker = new StatusChecker(context); if (statusChecker.noXMLParsingErrorsOccurred(threshold)) { addInfo("Registering current configuration as safe fallback point"); registerSafeConfiguration(); } }
public final void doConfigure(final InputSource inputSource) throws JoranException { long threshold = System.currentTimeMillis(); if (!ConfigurationWatchListUtil.wasConfigurationWatchListReset(context)) { informContextOfURLUsedForConfiguration(getContext(), null); } SaxEventRecorder recorder = new SaxEventRecorder(); recorder.setContext(context); recorder.recordEvents(inputSource); doConfigure(recorder.saxEventList); // no exceptions a this level StatusChecker statusChecker = new StatusChecker(context); if (statusChecker.noXMLParsingErrorsOccurred(threshold)) { addInfo("Registering current configuration as safe fallback point"); registerSafeConfiguration(); } }
@Override public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { SaxEventRecorder recorder = new SaxEventRecorder(context); this.attributeInUse = null; this.optional = OptionHelper.toBoolean(attributes.getValue(OPTIONAL_ATTR), false); if (!checkAttributes(attributes)) { return; } InputStream in = getInputStream(ec, attributes); try { if (in != null) { parseAndRecord(in, recorder); // remove the <included> tag from the beginning and </included> from the end trimHeadAndTail(recorder); // offset = 2, because we need to get past this element as well as the end element ec.getJoranInterpreter().getEventPlayer().addEventsDynamically(recorder.saxEventList, 2); } } catch (JoranException e) { addError("Error while parsing " + attributeInUse, e); } finally { close(in); } }
@Override public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { SaxEventRecorder recorder = new SaxEventRecorder(context); this.attributeInUse = null; this.optional = OptionHelper.toBoolean(attributes.getValue(OPTIONAL_ATTR), false); if (!checkAttributes(attributes)) { return; } InputStream in = getInputStream(ec, attributes); try { if (in != null) { parseAndRecord(in, recorder); // remove the <included> tag from the beginning and </included> from the end trimHeadAndTail(recorder); // offset = 2, because we need to get past this element as well as the end element ec.getJoranInterpreter().getEventPlayer().addEventsDynamically(recorder.saxEventList, 2); } } catch (JoranException e) { addError("Error while parsing " + attributeInUse, e); } finally { close(in); } }
@Override public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { SaxEventRecorder recorder = new SaxEventRecorder(context); this.attributeInUse = null; this.optional = OptionHelper.toBoolean(attributes.getValue(OPTIONAL_ATTR), false); if (!checkAttributes(attributes)) { return; } InputStream in = getInputStream(ec, attributes); try { if (in != null) { parseAndRecord(in, recorder); // remove the <included> tag from the beginning and </included> from the end trimHeadAndTail(recorder); // offset = 2, because we need to get past this element as well as the end element ec.getJoranInterpreter().getEventPlayer().addEventsDynamically(recorder.saxEventList, 2); } } catch (JoranException e) { addError("Error while parsing " + attributeInUse, e); } finally { close(in); } }
@Override public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { SaxEventRecorder recorder = new SaxEventRecorder(context); this.attributeInUse = null; this.optional = OptionHelper.toBoolean(attributes.getValue(OPTIONAL_ATTR), false); if (!checkAttributes(attributes)) { return; } InputStream in = getInputStream(ec, attributes); try { if (in != null) { parseAndRecord(in, recorder); // remove the <included> tag from the beginning and </included> from the end trimHeadAndTail(recorder); // offset = 2, because we need to get past this element as well as the end element ec.getJoranInterpreter().getEventPlayer().addEventsDynamically(recorder.saxEventList, 2); } } catch (JoranException e) { addError("Error while parsing " + attributeInUse, e); } finally { close(in); } }
@Override public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { SaxEventRecorder recorder = new SaxEventRecorder(); this.attributeInUse = null; if (!checkAttributes(attributes)) { return; } InputStream in = getInputStream(ec, attributes); try { if (in != null) { parseAndRecord(in, recorder); } } catch (JoranException e) { addError("Error while parsing " + attributeInUse, e); } finally { close(in); } // remove the <included> tag from the beginning and </included> from the end trimHeadAndTail(recorder); ec.getJoranInterpreter().addEventsDynamically(recorder.saxEventList); }
@Override public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { SaxEventRecorder recorder = new SaxEventRecorder(); this.attributeInUse = null; if (!checkAttributes(attributes)) { return; } InputStream in = getInputStream(ec, attributes); try { if (in != null) { parseAndRecord(in, recorder); // remove the <included> tag from the beginning and </included> from the end trimHeadAndTail(recorder); // offset = 2, because we need to get past this element as well as the end element ec.getJoranInterpreter().getEventPlayer().addEventsDynamically(recorder.saxEventList, 2); } } catch (JoranException e) { addError("Error while parsing " + attributeInUse, e); } finally { close(in); } }
@Override public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { SaxEventRecorder recorder = new SaxEventRecorder(); this.attributeInUse = null; if (!checkAttributes(attributes)) { return; } InputStream in = getInputStream(ec, attributes); try { if (in != null) { parseAndRecord(in, recorder); // remove the <included> tag from the beginning and </included> from the end trimHeadAndTail(recorder); // offset = 2, because we need to get past this element as well as the end element ec.getJoranInterpreter().getEventPlayer().addEventsDynamically(recorder.saxEventList, 2); } } catch (JoranException e) { addError("Error while parsing " + attributeInUse, e); } finally { close(in); } }