public abstract class AbstractJobOperator extends Object implements javax.batch.operations.JobOperator
JobOperator
. Subclasses should generally delegate to the super methods of
this abstraction.Constructor and Description |
---|
AbstractJobOperator() |
Modifier and Type | Method and Description |
---|---|
void |
abandon(long executionId) |
abstract BatchEnvironment |
getBatchEnvironment()
Returns the batch environment that should be used for this JobOperator.
|
javax.batch.runtime.JobExecution |
getJobExecution(long executionId) |
protected JobExecutionImpl |
getJobExecutionImpl(long executionId)
Returns the job execution implementation found in the job repository.
|
List<javax.batch.runtime.JobExecution> |
getJobExecutions(javax.batch.runtime.JobInstance instance) |
javax.batch.runtime.JobInstance |
getJobInstance(long executionId) |
int |
getJobInstanceCount(String jobName) |
List<javax.batch.runtime.JobInstance> |
getJobInstances(String jobName,
int start,
int count) |
Set<String> |
getJobNames() |
JobRepository |
getJobRepository()
This is equivalent to
getBatchEnvironment().getJobRepository() . |
Properties |
getParameters(long executionId) |
List<Long> |
getRunningExecutions(String jobName) |
List<javax.batch.runtime.StepExecution> |
getStepExecutions(long jobExecutionId) |
long |
restart(long executionId,
Properties restartParameters) |
long |
restart(long executionId,
Properties restartParameters,
String user)
Restarts a stopped or failed job with the specified user.
|
long |
start(Job jobDefined,
Properties jobParameters)
Starts a pre-configured
Job instance, with job parameters. |
long |
start(Job jobDefined,
Properties jobParameters,
String user)
Starts a pre-configured
Job instance, with job parameters and sets the user on the execution |
long |
start(String jobXMLName,
Properties jobParameters) |
long |
start(String jobXMLName,
Properties jobParameters,
String user)
Creates a new job instance and starts the first execution of that instance.
|
void |
stop(long executionId) |
public abstract BatchEnvironment getBatchEnvironment()
null
.public JobRepository getJobRepository()
getBatchEnvironment().getJobRepository()
.public long start(String jobXMLName, Properties jobParameters) throws javax.batch.operations.JobStartException, javax.batch.operations.JobSecurityException
start
in interface javax.batch.operations.JobOperator
javax.batch.operations.JobStartException
javax.batch.operations.JobSecurityException
public long start(String jobXMLName, Properties jobParameters, String user) throws javax.batch.operations.JobStartException, javax.batch.operations.JobSecurityException
jobXMLName
- specifies the name of the job XML describing the jobjobParameters
- specifies the keyword/value pairs for attribute substitution in the Job XMLuser
- the user to associate with the job executionjavax.batch.operations.JobStartException
- if the job failed to startjavax.batch.operations.JobSecurityException
- if there is a security issue with starting the jobstart(String, Properties)
public long start(Job jobDefined, Properties jobParameters) throws javax.batch.operations.JobStartException, javax.batch.operations.JobSecurityException
Job
instance, with job parameters.jobDefined
- a pre-configured jobjobParameters
- job parameters for the current job executionjavax.batch.operations.JobStartException
- if failed to start the jobjavax.batch.operations.JobSecurityException
- if failed to start the job due to security permissionJobBuilder
public long start(Job jobDefined, Properties jobParameters, String user) throws javax.batch.operations.JobStartException, javax.batch.operations.JobSecurityException
Job
instance, with job parameters and sets the user on the executionjobDefined
- a pre-configured jobjobParameters
- job parameters for the current job executionuser
- the user to associate with the job executionjavax.batch.operations.JobStartException
- if failed to start the jobjavax.batch.operations.JobSecurityException
- if failed to start the job due to security permissionJobBuilder
public void stop(long executionId) throws javax.batch.operations.NoSuchJobExecutionException, javax.batch.operations.JobExecutionNotRunningException, javax.batch.operations.JobSecurityException
stop
in interface javax.batch.operations.JobOperator
javax.batch.operations.NoSuchJobExecutionException
javax.batch.operations.JobExecutionNotRunningException
javax.batch.operations.JobSecurityException
public Set<String> getJobNames() throws javax.batch.operations.JobSecurityException
getJobNames
in interface javax.batch.operations.JobOperator
javax.batch.operations.JobSecurityException
public int getJobInstanceCount(String jobName) throws javax.batch.operations.NoSuchJobException, javax.batch.operations.JobSecurityException
getJobInstanceCount
in interface javax.batch.operations.JobOperator
javax.batch.operations.NoSuchJobException
javax.batch.operations.JobSecurityException
public List<javax.batch.runtime.JobInstance> getJobInstances(String jobName, int start, int count) throws javax.batch.operations.NoSuchJobException, javax.batch.operations.JobSecurityException
getJobInstances
in interface javax.batch.operations.JobOperator
javax.batch.operations.NoSuchJobException
javax.batch.operations.JobSecurityException
public List<Long> getRunningExecutions(String jobName) throws javax.batch.operations.NoSuchJobException, javax.batch.operations.JobSecurityException
getRunningExecutions
in interface javax.batch.operations.JobOperator
javax.batch.operations.NoSuchJobException
javax.batch.operations.JobSecurityException
public Properties getParameters(long executionId) throws javax.batch.operations.NoSuchJobExecutionException, javax.batch.operations.JobSecurityException
getParameters
in interface javax.batch.operations.JobOperator
javax.batch.operations.NoSuchJobExecutionException
javax.batch.operations.JobSecurityException
public long restart(long executionId, Properties restartParameters) throws javax.batch.operations.JobExecutionAlreadyCompleteException, javax.batch.operations.NoSuchJobExecutionException, javax.batch.operations.JobExecutionNotMostRecentException, javax.batch.operations.JobRestartException, javax.batch.operations.JobSecurityException
restart
in interface javax.batch.operations.JobOperator
javax.batch.operations.JobExecutionAlreadyCompleteException
javax.batch.operations.NoSuchJobExecutionException
javax.batch.operations.JobExecutionNotMostRecentException
javax.batch.operations.JobRestartException
javax.batch.operations.JobSecurityException
public long restart(long executionId, Properties restartParameters, String user) throws javax.batch.operations.JobExecutionAlreadyCompleteException, javax.batch.operations.NoSuchJobExecutionException, javax.batch.operations.JobExecutionNotMostRecentException, javax.batch.operations.JobRestartException, javax.batch.operations.JobSecurityException
executionId
- the execution id used for the restart, this must be the most recent executionrestartParameters
- the new properties used for the restartuser
- the user to associate with the job executionjavax.batch.operations.JobExecutionAlreadyCompleteException
- if the job was already completedjavax.batch.operations.NoSuchJobExecutionException
- the job does not existjavax.batch.operations.JobExecutionNotMostRecentException
- if the execution id is not the most recent executionjavax.batch.operations.JobRestartException
- of the job failed to restartjavax.batch.operations.JobSecurityException
- if failed to start the job due to security permissionpublic void abandon(long executionId) throws javax.batch.operations.NoSuchJobExecutionException, javax.batch.operations.JobExecutionIsRunningException, javax.batch.operations.JobSecurityException
abandon
in interface javax.batch.operations.JobOperator
javax.batch.operations.NoSuchJobExecutionException
javax.batch.operations.JobExecutionIsRunningException
javax.batch.operations.JobSecurityException
public javax.batch.runtime.JobInstance getJobInstance(long executionId) throws javax.batch.operations.NoSuchJobExecutionException, javax.batch.operations.JobSecurityException
getJobInstance
in interface javax.batch.operations.JobOperator
javax.batch.operations.NoSuchJobExecutionException
javax.batch.operations.JobSecurityException
public List<javax.batch.runtime.JobExecution> getJobExecutions(javax.batch.runtime.JobInstance instance) throws javax.batch.operations.NoSuchJobInstanceException, javax.batch.operations.JobSecurityException
getJobExecutions
in interface javax.batch.operations.JobOperator
javax.batch.operations.NoSuchJobInstanceException
javax.batch.operations.JobSecurityException
public javax.batch.runtime.JobExecution getJobExecution(long executionId) throws javax.batch.operations.NoSuchJobExecutionException, javax.batch.operations.JobSecurityException
getJobExecution
in interface javax.batch.operations.JobOperator
javax.batch.operations.NoSuchJobExecutionException
javax.batch.operations.JobSecurityException
public List<javax.batch.runtime.StepExecution> getStepExecutions(long jobExecutionId) throws javax.batch.operations.NoSuchJobExecutionException, javax.batch.operations.JobSecurityException
getStepExecutions
in interface javax.batch.operations.JobOperator
javax.batch.operations.NoSuchJobExecutionException
javax.batch.operations.JobSecurityException
protected JobExecutionImpl getJobExecutionImpl(long executionId) throws javax.batch.operations.NoSuchJobExecutionException
executionId
- the execution idjavax.batch.operations.NoSuchJobExecutionException
- if the job was not found in the repositoryCopyright © 2018 JBoss by Red Hat. All rights reserved.