public void run() { log.debug("Polling started"); PollResult result = null; try { result = source.poll(false, getNextCheckPoint(checkPoint)); checkPoint = result.getCheckPoint(); fireEvent(EventType.POLL_SUCCESS, result, null); } catch (Throwable e) { log.error("Error getting result from polling source", e); fireEvent(EventType.POLL_FAILURE, null, e); return; } try { populateProperties(result, config); } catch (Throwable e) { log.error("Error occured applying properties", e); } }
public void run() { log.debug("Polling started"); PollResult result = null; try { result = source.poll(false, getNextCheckPoint(checkPoint)); checkPoint = result.getCheckPoint(); fireEvent(EventType.POLL_SUCCESS, result, null); } catch (Throwable e) { log.error("Error getting result from polling source", e); fireEvent(EventType.POLL_FAILURE, null, e); return; } try { populateProperties(result, config); } catch (Throwable e) { log.error("Error occured applying properties", e); } }
/** * Do an initial poll from the source and apply the result to the configuration. * * @param source source of the configuration * @param config Configuration to apply the polling result * @throws RuntimeException if any error occurs in polling the configuration source */ protected synchronized void initialLoad(final PolledConfigurationSource source, final Configuration config) { PollResult result = null; try { result = source.poll(true, null); checkPoint = result.getCheckPoint(); fireEvent(EventType.POLL_SUCCESS, result, null); } catch (Throwable e) { throw new RuntimeException("Unable to load Properties source from " + source, e); } try { populateProperties(result, config); } catch (Throwable e) { throw new RuntimeException("Unable to load Properties", e); } }
/** * Do an initial poll from the source and apply the result to the configuration. * * @param source source of the configuration * @param config Configuration to apply the polling result * @throws RuntimeException if any error occurs in polling the configuration source */ protected synchronized void initialLoad(final PolledConfigurationSource source, final Configuration config) { PollResult result = null; try { result = source.poll(true, null); checkPoint = result.getCheckPoint(); fireEvent(EventType.POLL_SUCCESS, result, null); } catch (Throwable e) { throw new RuntimeException("Unable to load Properties source from " + source, e); } try { populateProperties(result, config); } catch (Throwable e) { throw new RuntimeException("Unable to load Properties", e); } }