org.stringer.thread
Class UpdateFeeds

java.lang.Object
  |
  +--EDU.oswego.cs.dl.util.concurrent.ThreadFactoryUser
        |
        +--EDU.oswego.cs.dl.util.concurrent.misc.SwingWorker
              |
              +--org.stringer.thread.AbstractSwingWorker
                    |
                    +--org.stringer.thread.UpdateFeeds
All Implemented Interfaces:
java.lang.Runnable

public class UpdateFeeds
extends AbstractSwingWorker

Load all items in a given channel or load all feeds in a mixed list of channels and items.

Note: This thread is used by the TreeView to update feeds. The TreeView consists of folders which are received here as Channels. The leaves or Items in the TreeView are the actual channels to be downloaded and displayed in the HtmlView.

Either the list is given a value or the channel is given a value; but not both. If both are set, only the channel will be seen.

Author:
R. Kevin Cole kcole@users.sourceforge.net

Field Summary
(package private)  Channel channel
          A channel to be downloaded
(package private)  Feed feed
           
(package private)  java.util.List list
          A list that can contain a mixture of channels and/or items
(package private) static org.apache.log4j.Logger logger
           
 
Fields inherited from class org.stringer.thread.AbstractSwingWorker
buildDate, listenerList, monitor, running
 
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.misc.SwingWorker
 
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.ThreadFactoryUser
threadFactory_
 
Constructor Summary
UpdateFeeds(IThreadListener listener)
           
 
Method Summary
protected  java.lang.Object construct()
          Called when the thread is starting to do the actual work.
protected  java.lang.Object getFeed(Channel channel)
          Load the article on this channel
protected  java.lang.Object getFeed(java.util.List list)
          Load the articles in this list.
protected  void saveChannel(Channel channel)
          Save a channel
 void saveItem(Item item)
          Save an item
 void setChannel(Channel channel)
          set the channel to be updated
 void setList(java.util.List list)
          set the list of channel and channel-items to be updated
 
Methods inherited from class org.stringer.thread.AbstractSwingWorker
addThreadListener, finished, fireBegin, fireBeginUnit, fireCanceled, fireEndUnit, fireThreadComplete, getBuildDate, getProgressMonitor, interrupt, isRunning, removeThreadListener, setProgressMonitor, setRunning
 
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.misc.SwingWorker
get, getException, getTimeout, isReady, run, start, timedGet
 
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.ThreadFactoryUser
getThreadFactory, setThreadFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger

list

java.util.List list
A list that can contain a mixture of channels and/or items


channel

Channel channel
A channel to be downloaded


feed

Feed feed
Constructor Detail

UpdateFeeds

public UpdateFeeds(IThreadListener listener)
Method Detail

setChannel

public void setChannel(Channel channel)
set the channel to be updated

Parameters:
channel - A Channel containing Items to be updated

setList

public void setList(java.util.List list)
set the list of channel and channel-items to be updated

Parameters:
list - A list of Channels and/or Items.

construct

protected java.lang.Object construct()
                              throws java.lang.InterruptedException
Called when the thread is starting to do the actual work.

Specified by:
construct in class EDU.oswego.cs.dl.util.concurrent.misc.SwingWorker
Returns:
either a list or a channel depending on how the thread was initialized
java.lang.InterruptedException

getFeed

protected java.lang.Object getFeed(Channel channel)
Load the article on this channel

Returns:
the channel that was loaded.

getFeed

protected java.lang.Object getFeed(java.util.List list)
Load the articles in this list.

Returns:
the list that was loaded.

saveChannel

protected void saveChannel(Channel channel)
Save a channel


saveItem

public void saveItem(Item item)
Save an item



Copyright © R. Kevin Cole. All Rights Reserved.