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:
JobHandler, Threadable

public class FlushTimeHelper
extends java.lang.Object
implements Threadable, JobHandler


Constructor Summary
FlushTimeHelper(Queue msgQueue, P2PDirectory directoryObj, HoldTimeHelper hoHelper)
          Creates a new instance of HoldTimeHelper
 
Method Summary
 boolean getReadyState()
           
 void handleAction()
          Implements Theadable interface.
 void handleJob(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(Queue msgQueue,
                       P2PDirectory directoryObj,
                       HoldTimeHelper hoHelper)
                throws AutoMedException
Creates a new instance of HoldTimeHelper

Throws:
AutoMedException
Method Detail

isRunning

public boolean isRunning()

getReadyState

public boolean getReadyState()
Specified by:
getReadyState in interface Threadable

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 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 Threadable
Throws:
AutoMedException

handleJob

public void handleJob(Job job)
               throws AutoMedException
Implement JobHandler interface.
This method is invoked by every job thread to handle job

Specified by:
handleJob in interface JobHandler
Throws:
AutoMedException