|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JobExecutor
This interface must be implemented by all classes that want's to act
as a job executor. A job executor is responsible for executing a job
when the job agent reqeusts so. The job executor to use is specfied
by the agent.executor.class
configuration setting.
Each agent only has one instance of a job executor, which means
that a job executor must be thread-safe and able to execute more than
one job at a time. It is not a good solution to put the synchonrized
keyword on the executeJob(SessionControl, Agent, Job, JobAgentSettings, Job.ExecutionTime)
method since it would limit the execution to one job at a time.
A job executor must provide a public no-argument constructor.
Method Summary | |
---|---|
void |
close()
This method is called at when the agent is stopped or paused. |
void |
executeJob(SessionControl sc,
Agent agent,
Job job,
JobAgentSettings settings,
Job.ExecutionTime usedSlot)
Execute the specified job. |
void |
init(Agent agent)
Initialize the job executor. |
Method Detail |
---|
void init(Agent agent)
agent
- The agentvoid executeJob(SessionControl sc, Agent agent, Job job, JobAgentSettings settings, Job.ExecutionTime usedSlot)
The job sent to this method has it's status set to Job.Status.PREPARED
.
The implementation of this method must change the status to either
Job.Status.DONE
or Job.Status.ERROR
. If the status hasn't changed
the job agent will set the status to signal an unknown error.
sc
- A SessionControl
where the owner of the job is
logged in and the correct active project is setagent
- The agent that sent the request to execute the jobjob
- The job to executesettings
- The specific settings used for the plugin on this job agent
or null if no settings has been specifiedusedSlot
- The slot that was used to execut the jobvoid close()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |