org.mmbase.module.builders.vwms
Class ImagePusher

java.lang.Object
  |
  +--org.mmbase.module.builders.vwms.ImagePusher
All Implemented Interfaces:
java.lang.Runnable

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).

Version:
9 Apr 2001
Author:
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

ImagePusher

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

init

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

start

public void start()
Starts the main Thread.

stop

public void stop()
Stops the main Thread.

run

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

doWork

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