org.mmbase.module.builders.vwms
Class JudasURLpusher

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

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

A background process that registers pagechanges and pushes for reloads of those pages, for proxy caching (and mirroring).

Version:
10 Apr 2001
Author:
Rico Jansen, Pierre van Rooden (javadocs)

Constructor Summary
JudasURLpusher(Judas parent)
          Constructor of the URL pusher class.
 
Method Summary
 void addURL(java.lang.String url)
          Adds a url to be scheduled for reload.
 void addURL(java.lang.String url, int priority)
          Adds a url to be scheduled for reload.
 void doWork()
          Main work loop.
 void init()
          Intializes the class.
 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

JudasURLpusher

public JudasURLpusher(Judas parent)
Constructor of the URL pusher class.
Parameters:
parent - the instance that starts the class
Method Detail

init

public void init()
Intializes the class. Starts the thread for this class.

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
See Also:
doWork()

doWork

public void doWork()
Main work loop. Periodically checks the list of urls to be reloaded. If any urls with a maximum priority exist, they are pushed to be reloaded. After this, the priority of all remaining urls are increased by one (to be scheduled for handling next time).

addURL

public void addURL(java.lang.String url)
Adds a url to be scheduled for reload. The url has to be a relative url eg. /3voor12/bla/index.shtml?123+456 . If no parameters are given, the url STILL has to have a '?' character eg. /3voor12/test.shtml? Uses default priority for scheduling reload. The urls are added to a queue that is periodically emptied by the workloop. Any duplicate urls are removed from the queue to improve performance.
Parameters:
url - the url to reload

addURL

public void addURL(java.lang.String url,
                   int priority)
Adds a url to be scheduled for reload. The url has to be a relative url eg. /3voor12/bla/index.shtml?123+456 . If no parameters are given, the url STILL has to have a '?' character eg. /3voor12/test.shtml? The urls are added to a queue that is periodically emptied by the workloop. Any duplicate urls are removed from the queue to improve performance.
Parameters:
url - the url to reload
priority - priority at which the url needs to be reloaded


MMBase 2001