Class ImagePusher

All Implemented Interfaces:

public class ImagePusher
extends java.lang.Object
implements java.lang.Runnable

A class used to schedule images for transfer. ImagePusher periodically (approx. every 4 seconds) checks it's parent's (ImageMaster) filelist, and pushes the fields in that list on a Queue, which is, in turn, handled by a FileCopier instance.
The reason that this is done by ImagePusher, and not ImageMaster, is that this way double requests for the same file can be filtered out. This seems useful, so perhaps PageMaster might need to use this scheduling system too (or otherwise this should be build into FileCopier).

9 Apr 2001
Rico Jansen, Pierre van Rooden (javadocs)

Constructor Summary
ImagePusher(ImageMaster parent)
          Constructor for the ImagePusher
Method Summary
 void doWork()
          Main work loop.
 void init()
          Initializes the insatnce by starting a thread.
 void run()
          Main loop, exception protected
 void start()
          Starts the main Thread.
 void stop()
          Stops the main Thread.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ImagePusher(ImageMaster parent)
Constructor for the ImagePusher
parent - The parent that contains and adds the files to handle.
Method Detail


public void init()
Initializes the insatnce by starting a thread.


public void start()
Starts the main Thread.


public void stop()
Stops the main Thread.


public void run()
Main loop, exception protected
Specified by:
run in interface java.lang.Runnable


public void doWork()
Main work loop. Periodically checks the files field of its parent. If new files need to be transferred, the files in the parent are cleared. The original list is then purged of duplicates before they are stored in the Queue. A seperate thread (FileCopier) then takes care of the actual transfer.

MMBase 2001