Package fr.becpg.repo.batch
Class BatchQueueServiceImpl.BatchCommand<T>
java.lang.Object
fr.becpg.repo.batch.BatchQueueServiceImpl.BatchCommand<T>
- All Implemented Interfaces:
Runnable
- Enclosing class:
BatchQueueServiceImpl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordWhat a step reported, whichever way it was run. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AuditScopeprivate Stringprivate BatchInfoprivate BatchClosingHook -
Constructor Summary
ConstructorsConstructorDescriptionBatchCommand(BatchInfo batchInfo, List<BatchStep<T>> batchSteps, BatchClosingHook closingHook) -
Method Summary
Modifier and TypeMethodDescriptionprivate StringSame shape as BatchProcessor.getLastError, so listeners see one thing.private voidbooleanprivate BatchQueueServiceImplprivate org.alfresco.repo.batch.BatchProcessWorkProvider<T> getNextWorkWrapper(org.alfresco.repo.batch.BatchProcessWorkProvider<T> workProvider) inthashCode()private voidpauseCommand(BatchQueueServiceImpl.BatchCommand<?> command) Moves a command to the paused queue.private voidpushAndSetBatchAuthentication(BatchStep<T> batchStep) voidrun()private org.alfresco.repo.batch.BatchProcessor.BatchProcessWorker<T> runAsWrapper(BatchStep<T> batchStep) runStepInTransaction(BatchStep<T> batchStep) The default: Alfresco's BatchProcessor opens a transaction around every entry.runStepOutsideTransaction(BatchStep<T> batchStep) Runs the step without opening a transaction around it, for work that waits on something other than the database and must not hold a transaction while it does.
-
Field Details
-
batchId
-
batchInfo
-
batchSteps
-
closingHook
-
auditScope
-
-
Constructor Details
-
BatchCommand
public BatchCommand(BatchInfo batchInfo, List<BatchStep<T>> batchSteps, BatchClosingHook closingHook)
-
-
Method Details
-
getBatchInfo
-
getBatchId
-
run
public void run() -
pauseCommand
Moves a command to the paused queue. A paused command leaves the running list, so that the running list only ever names the batch that is actually progressing, and it is never queued twice, so that its own completion is enough to clear it from the paused queue. -
pushAndSetBatchAuthentication
-
getNextWorkWrapper
-
runStepInTransaction
The default: Alfresco's BatchProcessor opens a transaction around every entry. -
runStepOutsideTransaction
private BatchQueueServiceImpl.BatchCommand.StepOutcome runStepOutsideTransaction(BatchStep<T> batchStep) Runs the step without opening a transaction around it, for work that waits on something other than the database and must not hold a transaction while it does. The worker takes care of its own transactions. Everything the transactional path offers is kept: the same wrapper, so the same authentication, pause and cancellation handling and the same progress counter; one entry at a time, so a pause is honoured between entries; and an entry that throws is counted and logged without stopping the rest, as BatchProcessor does. -
asReportedByBatchProcessor
Same shape as BatchProcessor.getLastError, so listeners see one thing. -
runAsWrapper
-
checkPausedCommand
private void checkPausedCommand() -
hashCode
public int hashCode() -
equals
-
getEnclosingInstance
-