g-Eclipse
Release 1.0.0

eu.geclipse.core
Class JobStatusUpdater

java.lang.Object
  extended by Job
      extended by eu.geclipse.core.JobStatusUpdater

public class JobStatusUpdater
extends Job

The class for updating job status in the background. There is one JobStatusUpdater for each job and it is started when a job is added to project.

See Also:
JobManager, IGridJobStatus, IGridJob

Constructor Summary
JobStatusUpdater(IGridJob job)
          Constructor
 
Method Summary
 void addJobStatusListener(int status, IGridJobStatusListener listener)
          Add status listener for the updater.
 IGridJob getJob()
           
 void removeJobStatusListener(IGridJobStatusListener listener)
          Removes registrered job status listener
 void setRemoved()
          Mark IGridJob connected with this updater as removed, what means that this updater should stop to schedule itself.
 void statusUpdated(IGridJobStatus newStatus)
          Used when job status was updated outside of the updater.
 void wakeUpdater()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobStatusUpdater

public JobStatusUpdater(IGridJob job)
Constructor

Parameters:
job - for which this updater is created
Method Detail

getJob

public IGridJob getJob()
Returns:
Job for which this updater is running.

statusUpdated

public void statusUpdated(IGridJobStatus newStatus)
Used when job status was updated outside of the updater. Checks if status changed from previous update. If so informs all listeners that status has changed.

Parameters:
newStatus - Fetched status

addJobStatusListener

public void addJobStatusListener(int status,
                                 IGridJobStatusListener listener)
Add status listener for the updater. The listener will be notify, when the status of the job will change.

Parameters:
status - - aggregate value of IGridJobStatus types, for which listener should be notified.
listener - - listener to be notifies about the change.

removeJobStatusListener

public void removeJobStatusListener(IGridJobStatusListener listener)
Removes registrered job status listener

Parameters:
listener -

setRemoved

public void setRemoved()
Mark IGridJob connected with this updater as removed, what means that this updater should stop to schedule itself.
Note, that this is not the same as cancelled, because cancel interupt only currect updating, so next updating will be scheduled


wakeUpdater

public void wakeUpdater()

g-Eclipse
Release 1.0.0