net.sourceforge.rssowl.controller.thread
Class FeedAutoUpdater

java.lang.Object
  extended byjava.lang.Thread
      extended bynet.sourceforge.rssowl.controller.thread.FeedAutoUpdater
All Implemented Interfaces:
Runnable

public class FeedAutoUpdater
extends Thread

The RSSAutoUpdater checks a Hashtable every 5 seconds and reloads each Favorite which update date is before the current date. After reload the AutoUpdater will remove the update date from the Hashtable and put a new one in it, which is calculated with the update interval value of the Favorite.

Version:
1.1.3
Author:
Benjamin Pasero

Field Summary
(package private)  Favorite currentRSSOwlFavorite
          Favorite to update
private static TreeSet dateList
          The treeset holding each favorite that has a update interval
private static Hashtable feedList
          The hashtable holding each favorite that has a update interval
(package private)  GUI rssOwlGui
          The RSSOwl Maincontroller
private static long uniqueCounter
          This long is used to create unique dates
private static int UPDATE_INTERVAL
          Interval to look for favorites that need an update
static int[] updateInterval
          Array containing the possible auto-update values
static String[] updateIntervalNames
          Array containing the i18n values for the update intervals
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FeedAutoUpdater(GUI rssOwlGui)
          Instantiates a new FeedAutoUpdater
 
Method Summary
static void removeFavorite(Favorite rssOwlFavorite)
          This method removes a Favorite from the feedList.
 void run()
          Check the feedList in a certain interval and update the next favorite which update date is before the current date.
static void updateFeedList(Favorite rssOwlFavorite)
          Update the feedList.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

updateInterval

public static int[] updateInterval
Array containing the possible auto-update values


updateIntervalNames

public static String[] updateIntervalNames
Array containing the i18n values for the update intervals


dateList

private static TreeSet dateList
The treeset holding each favorite that has a update interval


feedList

private static Hashtable feedList
The hashtable holding each favorite that has a update interval


uniqueCounter

private static long uniqueCounter
This long is used to create unique dates


UPDATE_INTERVAL

private static final int UPDATE_INTERVAL
Interval to look for favorites that need an update

See Also:
Constant Field Values

currentRSSOwlFavorite

Favorite currentRSSOwlFavorite
Favorite to update


rssOwlGui

GUI rssOwlGui
The RSSOwl Maincontroller

Constructor Detail

FeedAutoUpdater

public FeedAutoUpdater(GUI rssOwlGui)
Instantiates a new FeedAutoUpdater

Parameters:
rssOwlGui - The RSSOwl Maincontroller
Method Detail

removeFavorite

public static void removeFavorite(Favorite rssOwlFavorite)
This method removes a Favorite from the feedList. This method is synchronized, because it alters a Hashtable which might be iterated in the RSSAutoUpdater thread at the same time.

Parameters:
rssOwlFavorite - Favorite to remove

updateFeedList

public static void updateFeedList(Favorite rssOwlFavorite)
Update the feedList. This method replaces the favorite from the feedList if the updateinterval is bigger than 0. Otherwise the favorite just gets removed from the list. This method is synchronized, because it alters a Hashtable which might be iterated in the RSSAutoUpdater thread at the same time.

Parameters:
rssOwlFavorite - Favorite to update

run

public void run()
Check the feedList in a certain interval and update the next favorite which update date is before the current date.



RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo