- All Implemented Interfaces:
public class ThreadJobExecutor extends Object implements JobExecutor
System.exit(int) would result in
all other jobs as well as the job agent getting killed.
The advantage is that there is no overhead in time or memory.
- Last modified
- $Date: 2021-06-04 12:40:45 +0200 (Fri, 04 Jun 2021) $
Nested Class Summary
Nested Classes Modifier and Type Class Description
private static class
Fields Modifier and Type Field Description
private static org.slf4j.LoggerLog job agent events.
Constructors Constructor Description
Modifier and Type Method Description
()This method is called at when the agent is stopped or paused.
SessionControl sc, Agent agent, Job job, JobAgentSettings settings, Job.ExecutionTime usedSlot)(Execute the specified job.
Agent agent)(Initialize the job executor.
logprivate static final org.slf4j.Logger logLog job agent events.
signalReceiverprivate SignalReceiver signalReceiver
initpublic void init(Agent agent)Initialize the job executor. This method is called once immediately after the object has been created.
executeJobpublic void executeJob(SessionControl sc, Agent agent, Job job, JobAgentSettings settings, Job.ExecutionTime usedSlot)Execute the specified job. This method is called in a new thread created specifically for running that job. If the agent is shutting down it will send an interrupt signal to all job threads. It is up to the job executor to decide how to handle this. It may either decide to kill the job or let it continue as if nothing happened.
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.ERROR. If the status hasn't changed the job agent will set the status to signal an unknown error.
- Specified by:
SessionControlwhere the owner of the job is logged in and the correct active project is set
agent- The agent that sent the request to execute the job
job- The job to execute
settings- The specific settings used for the plugin on this job agent or null if no settings has been specified
usedSlot- The slot that was used to execut the job
closepublic void close()This method is called at when the agent is stopped or paused. No more execution requests will be sent to the current job executor, but running jobs should NOT be terminated due to this method beeing called.
setSignalReceiverprivate void setSignalReceiver(SignalReceiver signalReceiver)
mainpublic static void main(String args)