uk.ac.ic.doc.automed.p2p.directory
Class FlushTimeHelper

java.lang.Object
  extended by uk.ac.ic.doc.automed.p2p.directory.FlushTimeHelper
All Implemented Interfaces:
uk.ac.ic.doc.automed.util.queue.JobHandler, uk.ac.ic.doc.automed.util.thread.Threadable

public class FlushTimeHelper
extends java.lang.Object
implements uk.ac.ic.doc.automed.util.thread.Threadable, uk.ac.ic.doc.automed.util.queue.JobHandler


Constructor Summary
FlushTimeHelper(uk.ac.ic.doc.automed.util.queue.Queue msgQueue, P2PDirectory directoryObj, HoldTimeHelper hoHelper)
          Creates a new instance of HoldTimeHelper
 
Method Summary
 void handleAction()
          Implements Theadable interface.
 void handleJob(uk.ac.ic.doc.automed.util.queue.Job job)
          Implement JobHandler interface.
This method is invoked by every job thread to handle job
 boolean isRunning()
           
 void reset()
          Reset the hold-time process when necessary
 void runAction()
          Implements Theadable interface This method acts as the background process at the server to update peer
status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlushTimeHelper

public FlushTimeHelper(uk.ac.ic.doc.automed.util.queue.Queue msgQueue,
                       P2PDirectory directoryObj,
                       HoldTimeHelper hoHelper)
Creates a new instance of HoldTimeHelper

Method Detail

isRunning

public boolean isRunning()

runAction

public void runAction()
               throws AutoMedException
Implements Theadable interface This method acts as the background process at the server to update peer
status. It is invoked at every hold_down and flush interval to check and
update peer's status appropriately.

Specified by:
runAction in interface uk.ac.ic.doc.automed.util.thread.Threadable
Throws:
AutoMedException

reset

public void reset()
Reset the hold-time process when necessary


handleAction

public void handleAction()
Implements Theadable interface. This method handles exceptions when running as a thread.

Specified by:
handleAction in interface uk.ac.ic.doc.automed.util.thread.Threadable
Throws:
AutoMedException

handleJob

public void handleJob(uk.ac.ic.doc.automed.util.queue.Job job)
               throws AutoMedException
Implement JobHandler interface.
This method is invoked by every job thread to handle job

Specified by:
handleJob in interface uk.ac.ic.doc.automed.util.queue.JobHandler
Throws:
AutoMedException