private void constructor( String name, JobType jobType, String cronExpression, JobParameters jobParameters, boolean continuousExecution, boolean enabled ) { this.name = name; this.cronExpression = cronExpression; this.jobType = jobType; this.jobParameters = jobParameters; this.continuousExecution = continuousExecution; this.enabled = enabled; setJobStatus( enabled ? SCHEDULED : DISABLED ); init(); }
public void jobConfigurationFinished( JobConfiguration jobConfiguration ) { runningJobConfigurations.remove( jobConfiguration ); JobConfiguration tempJobConfiguration = jobConfigurationService .getJobConfigurationByUid( jobConfiguration.getUid() ); if ( tempJobConfiguration != null ) { if ( tempJobConfiguration.getJobStatus() == DISABLED ) { jobConfiguration.setJobStatus( DISABLED ); jobConfiguration.setEnabled( false ); } jobConfigurationService.updateJobConfiguration( jobConfiguration ); } }
jobConfig.setJobStatus( SCHEDULED ); jobConfigurationService.updateJobConfiguration( jobConfig );
/** * Set status properties of job after finish. If the job was executed manually and the job is disabled we want * to set the status back to DISABLED. * * @param clock Clock for keeping track of time usage * @param schedulingManager reference to scheduling manager * @param jobConfiguration the job configuration */ private void setFinishingStatus( Clock clock, SchedulingManager schedulingManager, JobConfiguration jobConfiguration ) { if ( jobConfiguration.isInMemoryJob() ) { return; } if ( !jobConfiguration.isContinuousExecution() ) { jobConfiguration.setJobStatus( JobStatus.SCHEDULED ); } if ( !jobConfiguration.isEnabled() ) { jobConfiguration.setJobStatus( JobStatus.DISABLED ); } jobConfiguration.setNextExecutionTime( null ); jobConfiguration.setLastExecuted( new Date() ); jobConfiguration.setLastRuntimeExecution( clock.time() ); schedulingManager.jobConfigurationFinished( jobConfiguration ); }
jobConfiguration.setJobStatus( JobStatus.RUNNING ); schedulingManager.jobConfigurationStarted( jobConfiguration ); jobConfiguration.setNextExecutionTime( null );