Class InMemoryJobRepositoryService
java.lang.Object
org.wildfly.extension.batch.jberet.job.repository.InMemoryJobRepositoryService
- All Implemented Interfaces:
org.jberet.repository.JobRepository,org.jboss.msc.Service,org.jboss.msc.service.Service<org.jberet.repository.JobRepository>,org.jboss.msc.value.Value<org.jberet.repository.JobRepository>
public class InMemoryJobRepositoryService
extends Object
implements org.jboss.msc.service.Service<org.jberet.repository.JobRepository>
A service which provides an in-memory job repository.
- Author:
- James R. Perkins, Richard Opalka
-
Field Summary
Fields inherited from interface org.jboss.msc.service.Service
NULL -
Constructor Summary
ConstructorsConstructorDescriptionInMemoryJobRepositoryService(Consumer<org.jberet.repository.JobRepository> jobRepositoryConsumer, Integer executionRecordsLimit) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddJob(org.jberet.repository.ApplicationAndJobName applicationAndJobName, org.jberet.job.model.Job job) voidaddPartitionExecution(org.jberet.runtime.StepExecutionImpl enclosingStepExecution, org.jberet.runtime.PartitionExecutionImpl partitionExecution) voidaddStepExecution(org.jberet.runtime.JobExecutionImpl jobExecution, org.jberet.runtime.StepExecutionImpl stepExecution) intcountStepStartTimes(String stepName, long jobInstanceId) org.jberet.runtime.JobExecutionImplcreateJobExecution(org.jberet.runtime.JobInstanceImpl jobInstance, Properties jobParameters) org.jberet.runtime.JobInstanceImplcreateJobInstance(org.jberet.job.model.Job job, String applicationName, ClassLoader classLoader) org.jberet.runtime.StepExecutionImplcreateStepExecution(String stepName) org.jberet.runtime.StepExecutionImplfindOriginalStepExecutionForRestart(String stepName, org.jberet.runtime.JobExecutionImpl jobExecutionToRestart, ClassLoader classLoader) protected org.jberet.repository.JobRepositoryorg.jberet.job.model.JobgetJob(org.jberet.repository.ApplicationAndJobName applicationAndJobName) jakarta.batch.runtime.JobExecutiongetJobExecution(long jobExecutionId) List<jakarta.batch.runtime.JobExecution>getJobExecutions(jakarta.batch.runtime.JobInstance jobInstance) getJobExecutionsByJob(String jobName) getJobExecutionsByJob(String jobName, Integer executionRecordsLimit) jakarta.batch.runtime.JobInstancegetJobInstance(long jobInstanceId) intgetJobInstanceCount(String jobName) List<jakarta.batch.runtime.JobInstance>getJobInstances(String jobName) List<org.jberet.runtime.PartitionExecutionImpl>getPartitionExecutions(long stepExecutionId, org.jberet.runtime.StepExecutionImpl stepExecution, boolean notCompletedOnly, ClassLoader classLoader) getRunningExecutions(String jobName) List<jakarta.batch.runtime.StepExecution>getStepExecutions(long jobExecutionId, ClassLoader classLoader) org.jberet.repository.JobRepositorygetValue()booleanvoidvoidremoveJobExecutions(org.jberet.repository.JobExecutionSelector jobExecutionSelector) voidremoveJobInstance(long jobInstanceId) voidsavePersistentData(jakarta.batch.runtime.JobExecution jobExecution, org.jberet.runtime.AbstractStepExecution stepOrPartitionExecution) intsavePersistentDataIfNotStopping(jakarta.batch.runtime.JobExecution jobExecution, org.jberet.runtime.AbstractStepExecution abstractStepExecution) final voidstart(org.jboss.msc.service.StartContext context) voidstartJobRepository(org.jboss.msc.service.StartContext context) final voidstop(org.jboss.msc.service.StopContext context) voidstopJobExecution(org.jberet.runtime.JobExecutionImpl jobExecution) voidstopJobRepository(org.jboss.msc.service.StopContext context) voidupdateJobExecution(org.jberet.runtime.JobExecutionImpl jobExecution, boolean fullUpdate, boolean saveJobParameters) voidupdateStepExecution(jakarta.batch.runtime.StepExecution stepExecution) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.msc.Service
start, stopMethods inherited from interface org.jboss.msc.value.Value
getValue
-
Constructor Details
-
InMemoryJobRepositoryService
-
-
Method Details
-
startJobRepository
public void startJobRepository(org.jboss.msc.service.StartContext context) throws org.jboss.msc.service.StartException - Throws:
org.jboss.msc.service.StartException
-
stopJobRepository
public void stopJobRepository(org.jboss.msc.service.StopContext context) -
getDelegate
protected org.jberet.repository.JobRepository getDelegate() -
start
public final void start(org.jboss.msc.service.StartContext context) throws org.jboss.msc.service.StartException - Specified by:
startin interfaceorg.jboss.msc.Service- Throws:
org.jboss.msc.service.StartException
-
stop
public final void stop(org.jboss.msc.service.StopContext context) - Specified by:
stopin interfaceorg.jboss.msc.Service
-
getValue
public org.jberet.repository.JobRepository getValue() throws IllegalStateException, IllegalArgumentException- Specified by:
getValuein interfaceorg.jboss.msc.value.Value<org.jberet.repository.JobRepository>- Throws:
IllegalStateExceptionIllegalArgumentException
-
addJob
public void addJob(org.jberet.repository.ApplicationAndJobName applicationAndJobName, org.jberet.job.model.Job job) - Specified by:
addJobin interfaceorg.jberet.repository.JobRepository
-
removeJob
- Specified by:
removeJobin interfaceorg.jberet.repository.JobRepository
-
getJob
public org.jberet.job.model.Job getJob(org.jberet.repository.ApplicationAndJobName applicationAndJobName) - Specified by:
getJobin interfaceorg.jberet.repository.JobRepository
-
getJobNames
- Specified by:
getJobNamesin interfaceorg.jberet.repository.JobRepository
-
jobExists
WildFly JBeret subsystem validates a job name before each batch job operations. If a job name is invalid,
NoSuchJobExceptionwould already have been thrown. So this method is optimized to always return true.- Specified by:
jobExistsin interfaceorg.jberet.repository.JobRepository
-
createJobInstance
public org.jberet.runtime.JobInstanceImpl createJobInstance(org.jberet.job.model.Job job, String applicationName, ClassLoader classLoader) - Specified by:
createJobInstancein interfaceorg.jberet.repository.JobRepository
-
removeJobInstance
public void removeJobInstance(long jobInstanceId) - Specified by:
removeJobInstancein interfaceorg.jberet.repository.JobRepository
-
getJobInstance
public jakarta.batch.runtime.JobInstance getJobInstance(long jobInstanceId) - Specified by:
getJobInstancein interfaceorg.jberet.repository.JobRepository
-
getJobInstances
- Specified by:
getJobInstancesin interfaceorg.jberet.repository.JobRepository
-
getJobInstanceCount
- Specified by:
getJobInstanceCountin interfaceorg.jberet.repository.JobRepository
-
createJobExecution
public org.jberet.runtime.JobExecutionImpl createJobExecution(org.jberet.runtime.JobInstanceImpl jobInstance, Properties jobParameters) - Specified by:
createJobExecutionin interfaceorg.jberet.repository.JobRepository
-
getJobExecution
public jakarta.batch.runtime.JobExecution getJobExecution(long jobExecutionId) - Specified by:
getJobExecutionin interfaceorg.jberet.repository.JobRepository
-
getJobExecutions
public List<jakarta.batch.runtime.JobExecution> getJobExecutions(jakarta.batch.runtime.JobInstance jobInstance) - Specified by:
getJobExecutionsin interfaceorg.jberet.repository.JobRepository
-
updateJobExecution
public void updateJobExecution(org.jberet.runtime.JobExecutionImpl jobExecution, boolean fullUpdate, boolean saveJobParameters) - Specified by:
updateJobExecutionin interfaceorg.jberet.repository.JobRepository
-
stopJobExecution
public void stopJobExecution(org.jberet.runtime.JobExecutionImpl jobExecution) - Specified by:
stopJobExecutionin interfaceorg.jberet.repository.JobRepository
-
getRunningExecutions
- Specified by:
getRunningExecutionsin interfaceorg.jberet.repository.JobRepository
-
removeJobExecutions
public void removeJobExecutions(org.jberet.repository.JobExecutionSelector jobExecutionSelector) - Specified by:
removeJobExecutionsin interfaceorg.jberet.repository.JobRepository
-
getStepExecutions
public List<jakarta.batch.runtime.StepExecution> getStepExecutions(long jobExecutionId, ClassLoader classLoader) - Specified by:
getStepExecutionsin interfaceorg.jberet.repository.JobRepository
-
createStepExecution
- Specified by:
createStepExecutionin interfaceorg.jberet.repository.JobRepository
-
addStepExecution
public void addStepExecution(org.jberet.runtime.JobExecutionImpl jobExecution, org.jberet.runtime.StepExecutionImpl stepExecution) - Specified by:
addStepExecutionin interfaceorg.jberet.repository.JobRepository
-
updateStepExecution
public void updateStepExecution(jakarta.batch.runtime.StepExecution stepExecution) - Specified by:
updateStepExecutionin interfaceorg.jberet.repository.JobRepository
-
findOriginalStepExecutionForRestart
public org.jberet.runtime.StepExecutionImpl findOriginalStepExecutionForRestart(String stepName, org.jberet.runtime.JobExecutionImpl jobExecutionToRestart, ClassLoader classLoader) - Specified by:
findOriginalStepExecutionForRestartin interfaceorg.jberet.repository.JobRepository
-
countStepStartTimes
- Specified by:
countStepStartTimesin interfaceorg.jberet.repository.JobRepository
-
addPartitionExecution
public void addPartitionExecution(org.jberet.runtime.StepExecutionImpl enclosingStepExecution, org.jberet.runtime.PartitionExecutionImpl partitionExecution) - Specified by:
addPartitionExecutionin interfaceorg.jberet.repository.JobRepository
-
getPartitionExecutions
public List<org.jberet.runtime.PartitionExecutionImpl> getPartitionExecutions(long stepExecutionId, org.jberet.runtime.StepExecutionImpl stepExecution, boolean notCompletedOnly, ClassLoader classLoader) - Specified by:
getPartitionExecutionsin interfaceorg.jberet.repository.JobRepository
-
savePersistentData
public void savePersistentData(jakarta.batch.runtime.JobExecution jobExecution, org.jberet.runtime.AbstractStepExecution stepOrPartitionExecution) - Specified by:
savePersistentDatain interfaceorg.jberet.repository.JobRepository
-
savePersistentDataIfNotStopping
public int savePersistentDataIfNotStopping(jakarta.batch.runtime.JobExecution jobExecution, org.jberet.runtime.AbstractStepExecution abstractStepExecution) - Specified by:
savePersistentDataIfNotStoppingin interfaceorg.jberet.repository.JobRepository
-
getJobExecutionsByJob
- Specified by:
getJobExecutionsByJobin interfaceorg.jberet.repository.JobRepository
-
getJobExecutionsByJob
- Specified by:
getJobExecutionsByJobin interfaceorg.jberet.repository.JobRepository
-