org.gridbus.broker.farming.common
Class JobQueue

java.lang.Object
  extended byorg.gridbus.broker.farming.common.JobQueue

public class JobQueue
extends java.lang.Object

This class implements a job queue for each compute server. The queue also has listeners associated with it. So when a job is added to the queue, the listeners are notified so that they can take action

Author:
Srikumar Venugopal(srikumar@cs.mu.oz.au)

Constructor Summary
JobQueue()
          Constructor
 
Method Summary
 void addJob(Job j)
          Adds a job to the queue and notifies any listener that is registered with this queue
 void addListener(JobQueueListener jql)
          Adds/registers a listener to the job queue.
 Job getJob()
          Gets the job at the head of the job queue and removes it from the job queue Throws an exception if queue empty
 void removeListener(JobQueueListener jql)
          Removes/ deregisters the listener from the queue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobQueue

public JobQueue()
Constructor

Method Detail

addJob

public void addJob(Job j)
Adds a job to the queue and notifies any listener that is registered with this queue

Parameters:
j - - the job to be added to the queue.

addListener

public void addListener(JobQueueListener jql)
Adds/registers a listener to the job queue.

Parameters:
jql -

removeListener

public void removeListener(JobQueueListener jql)
                    throws java.lang.Exception
Removes/ deregisters the listener from the queue

Parameters:
jql -
Throws:
java.lang.Exception

getJob

public Job getJob()
           throws java.lang.Exception
Gets the job at the head of the job queue and removes it from the job queue Throws an exception if queue empty

Returns:
Job
Throws:
java.lang.Exception