public SimpleRSSFeedFetcher() { this.feedInfoCache = HashMapFeedInfoCache.getInstance(); }
public RSSRecordReader(String url) throws MalformedURLException { feedUrl = new URL(url); feedInfoCache = HashMapFeedInfoCache.getInstance(); fetcher = new HttpURLFeedFetcher(feedInfoCache); listener = new FetcherEventListenerImpl(this, LOGGER); fetcher.addFetcherEventListener(listener); }
@Override public Set<AggregateFeed> fetchAggregateFeeds(Set<AggregateFeed> aggregateFeeds) { ArrayList<Future<?>> futureList = new ArrayList<Future<?>>(); for (AggregateFeed aggregate : aggregateFeeds) { for (FeedChannel channel : aggregate.getChannels()) { Runnable task = componentProvider.newInstance(getFeedChannelFetchTaskClass(), new MgnlHttpURLFeedFetcher(HashMapFeedInfoCache.getInstance()), channel, aggregate.getName()); Future<?> future = executorService.submit(task); futureList.add(future); } } // Each Future will block on get() when not done, thus ensuring this method will return only when all // attempts to fetch feed aggregates have completed. for (Future<?> future : futureList) { waitForFutureResult(future); } return aggregateFeeds; }