com.archibus.jobmanager
Interface Job

All Known Implementing Classes:
JobBase

public interface Job

Base interface implemented by long-running jobs. It defines a contract between any job and the Job Manager (and indirectly the job client).


Method Summary
 JobStatus getStatus()
          Returns the current job status.This method is called by the Job Manager which runs in a different thread.
 void run()
          Starts the job.
 void stop()
          Requests the job to stop.
 

Method Detail

run

void run()
Starts the job. This method should only be called:

stop

void stop()
Requests the job to stop. This method is called by the Job Manager which runs in a different thread.

The implementation is assumed to set the internal flag, in a thread-safe manner. The run() method implementation is assumed to check the flag periodically, between units of work.

If the job does not stop after configurable time interval, the Job Manager may terminate the job thread.


getStatus

JobStatus getStatus()
Returns the current job status.This method is called by the Job Manager which runs in a different thread.

The status object is owned by the job implementation. The run() method should update the status object in a thread-safe manner.

Returns:
JobStatus


Copyright © 2009 ARCHIBUS, Inc. All Rights Reserved.