dk.netarkivet.harvester.scheduler
Class HarvesterStatusReceiver

java.lang.Object
  extended by dk.netarkivet.harvester.distribute.HarvesterMessageHandler
      extended by dk.netarkivet.harvester.scheduler.HarvesterStatusReceiver
All Implemented Interfaces:
ComponentLifeCycle, HarvesterMessageVisitor, javax.jms.MessageListener

public class HarvesterStatusReceiver
extends HarvesterMessageHandler
implements ComponentLifeCycle

Handles the reception of status messages from the harvesters. Will call the visit(HarvesterReadyMessage) method when a Ready message is received.


Constructor Summary
HarvesterStatusReceiver(JobDispatcher jobDispatcher, JMSConnection jmsConnection)
           
 
Method Summary
 void shutdown()
          The inverse of the start() method.
 void start()
          Implements functionality for starting an instances of this ComponentLifeCycle object.
 void visit(HarvesterReadyMessage message)
          Tells the dispatcher that it may dispatch a new job.
 
Methods inherited from class dk.netarkivet.harvester.distribute.HarvesterMessageHandler
onMessage, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HarvesterStatusReceiver

public HarvesterStatusReceiver(JobDispatcher jobDispatcher,
                               JMSConnection jmsConnection)
Parameters:
jobDispatcher - The JobDispatcher to delegate the dispatching of new jobs to, when a 'Ready for job' event is received.
jmsConnection - The JMS connection by which HarvesterReadyMessage is received.
Method Detail

start

public void start()
Description copied from interface: ComponentLifeCycle
Implements functionality for starting an instances of this ComponentLifeCycle object. This may be loading files, establish connections, initializing data, starting threads, etc.

Specified by:
start in interface ComponentLifeCycle

shutdown

public void shutdown()
Description copied from interface: ComponentLifeCycle
The inverse of the start() method. Contains functionality for deallocation of ressources, clearing data, closing connections, stopping threads, etc

Specified by:
shutdown in interface ComponentLifeCycle

visit

public void visit(HarvesterReadyMessage message)
Tells the dispatcher that it may dispatch a new job.

Specified by:
visit in interface HarvesterMessageVisitor
Overrides:
visit in class HarvesterMessageHandler
Parameters:
message - The message containing the relevant harvester information.