The basic reader will use a standard ScheduledThreadPoolExecutor class to execute the tasks periodically. We will execute a task per RSS source, and there will be one minute between the termination of one execution of a task and the commencement of the next execution. These concurrent tasks are implemented in the NewsTask class. It has three internal attributes to store the name of the RSS feed, its URL, and the NewsBuffer class to store the news:
public class NewsTask implements Runnable { private String name; private String url; private NewsBuffer buffer; public NewsTask (String name, String url, NewsBuffer buffer) { this.name=name; this.url=url; this.buffer=buffer; }
The run() method of this Runnable object simply parses ...