Class DummyJobExecutor
- java.lang.Object
-
- net.sf.basedb.clients.jobagent.executors.DummyJobExecutor
-
- All Implemented Interfaces:
JobExecutor
public class DummyJobExecutor extends Object implements JobExecutor
This is dummy job executor implementation which just sets the status of each job toJob.Status.DONE
without actually executing the job. This class is usful for debugging the job agent application.Configuration parameters Configuration parameter Default value Description agent.executor.dummy.wait Number of seconds it takes to execute a job. The implementation simly waits the specified number of seconds. If not specified the execution will return immediately. - Version:
- 2.0
- Author:
- nicklas
- Last modified
- $Date: 2015-04-21 09:59:42 +0200 (ti, 21 apr 2015) $
-
-
Constructor Summary
Constructors Constructor Description DummyJobExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
init
public void init(Agent agent)
Description copied from interface:JobExecutor
Initialize the job executor. This method is called once immediately after the object has been created.- Specified by:
init
in interfaceJobExecutor
- Parameters:
agent
- The agent
-
executeJob
public void executeJob(SessionControl sc, Agent agent, Job job, JobAgentSettings settings, Job.ExecutionTime usedSlot)
Description copied from interface:JobExecutor
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 eitherJob.Status.DONE
orJob.Status.ERROR
. If the status hasn't changed the job agent will set the status to signal an unknown error.- Specified by:
executeJob
in interfaceJobExecutor
- Parameters:
sc
- ASessionControl
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 job
-
close
public void close()
Description copied from interface:JobExecutor
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.- Specified by:
close
in interfaceJobExecutor
-
-