org.mmbase.applications.mmbob
Class ForumMMBaseSyncer

java.lang.Object
  extended by org.mmbase.applications.mmbob.ForumMMBaseSyncer
All Implemented Interfaces:
Runnable

public class ForumMMBaseSyncer
extends Object
implements Runnable

The syncer for Nodes used in MMBob. There can be different types of syncing mechanisms: slow for things like statistics and fast for really important things like postings, userinfo, etc This object is responsible for calling Node.commit(), of the MMBase nodes involved in MMBob. It does that only to spare the MMBase database. It maintains a queue of 'dirty nodes', and sometimes calls commit on one and cleans it up.

Version:
$Id: ForumMMBaseSyncer.java 35620 2009-06-03 13:46:59Z michiel $
Author:
Daniel Ockeloen, Gerard van Enk

Field Summary
(package private)  int delayTime
           
(package private)  Thread kicker
           
(package private)  int sleepTime
           
 
Constructor Summary
ForumMMBaseSyncer(int sleepTime, int maxQueue, int startDelay)
          Contructor
 
Method Summary
 void doWork()
          Main work loop Commit the nodes in the syncQueue to the database
 void init()
          init()
 void nodeDeleted(Node node)
          remove the given node from the syncQueue
(package private)  String printCurrentContent()
           
 void run()
          Main loop, exception protected
 void shutdownSync()
           
 void start()
          Starts the main Thread.
 void syncNode(Node node)
          add the given node to the syncQueue, to be synchronized at synchronization-time
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kicker

Thread kicker

sleepTime

final int sleepTime

delayTime

final int delayTime
Constructor Detail

ForumMMBaseSyncer

public ForumMMBaseSyncer(int sleepTime,
                         int maxQueue,
                         int startDelay)
Contructor

Parameters:
sleepTime - time to sleep
maxQueue - maximum number of nodes in the syncQueue (not implemented)
startDelay - delay (not implemented?)
Method Detail

init

public void init()
init()


start

public void start()
Starts the main Thread.


run

public void run()
Main loop, exception protected

Specified by:
run in interface Runnable

doWork

public void doWork()
Main work loop Commit the nodes in the syncQueue to the database


shutdownSync

public void shutdownSync()

nodeDeleted

public void nodeDeleted(Node node)
remove the given node from the syncQueue

Parameters:
node - node that has to be removed from the syncQueue

syncNode

public void syncNode(Node node)
add the given node to the syncQueue, to be synchronized at synchronization-time

Parameters:
node - the node that must added to the syncQueue

printCurrentContent

String printCurrentContent()

toString

public String toString()
Overrides:
toString in class Object


MMBase 2.0-SNAPSHOT - null