Package org.bonitasoft.engine.work
Class RetryingWorkExecutorService
java.lang.Object
org.bonitasoft.engine.work.RetryingWorkExecutorService
- All Implemented Interfaces:
LifecycleService,TenantLifecycleService,WorkExecutionCallback,WorkExecutorService
@Component
@ConditionalOnSingleCandidate(WorkExecutorService.class)
public class RetryingWorkExecutorService
extends Object
implements WorkExecutorService, WorkExecutionCallback
- Author:
- Baptiste Mesta.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRetryingWorkExecutorService(BonitaExecutorServiceFactory bonitaExecutorServiceFactory, EngineClock engineClock, long workTerminationTimeout, int maxRetry, int delay, double delayFactor, ExceptionRetryabilityEvaluator exceptionRetryabilityEvaluator, WorkExecutionAuditor workExecutionAuditor, io.micrometer.core.instrument.MeterRegistry meterRegistry, IncidentService incidentService) -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(WorkDescriptor work) voidhandleFailure(WorkDescriptor work, BonitaWork bonitaWork, Map<String, Object> context, Throwable thrown) booleanvoidnotifyNodeStopped(String nodeName) voidonFailure(WorkDescriptor work, BonitaWork bonitaWork, Map<String, Object> context, Throwable thrown) voidonSuccess(WorkDescriptor work) voidpause()Temporary halt the execution of this service.voidresume()resume the execution the servicevoidsetNumberOfFramesToLogInExceptions(int numberOfFramesToLogInExceptions) voidstart()Start the servicevoidstop()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bonitasoft.engine.commons.TenantLifecycleService
init
-
Field Details
-
NUMBER_OF_WORKS_RETRIED
- See Also:
-
numberOfFramesToLogInExceptions
public int numberOfFramesToLogInExceptions
-
-
Constructor Details
-
RetryingWorkExecutorService
public RetryingWorkExecutorService(BonitaExecutorServiceFactory bonitaExecutorServiceFactory, EngineClock engineClock, @Value("${bonita.tenant.work.terminationTimeout}") long workTerminationTimeout, @Value("${bonita.tenant.work.maxRetry}") int maxRetry, @Value("${bonita.tenant.work.retry.delay}") int delay, @Value("${bonita.tenant.work.retry.factor}") double delayFactor, ExceptionRetryabilityEvaluator exceptionRetryabilityEvaluator, WorkExecutionAuditor workExecutionAuditor, io.micrometer.core.instrument.MeterRegistry meterRegistry, IncidentService incidentService)
-
-
Method Details
-
setNumberOfFramesToLogInExceptions
@Value("${bonita.tenant.work.exceptionsNumberOfFrameToLog:3}") public void setNumberOfFramesToLogInExceptions(int numberOfFramesToLogInExceptions) -
onSuccess
- Specified by:
onSuccessin interfaceWorkExecutionCallback
-
onFailure
public void onFailure(WorkDescriptor work, BonitaWork bonitaWork, Map<String, Object> context, Throwable thrown) - Specified by:
onFailurein interfaceWorkExecutionCallback
-
handleFailure
public void handleFailure(WorkDescriptor work, BonitaWork bonitaWork, Map<String, Object> context, Throwable thrown) -
execute
- Specified by:
executein interfaceWorkExecutorService
-
stop
public void stop()- Specified by:
stopin interfaceLifecycleService
-
start
public void start()Description copied from interface:LifecycleServiceStart the service- Specified by:
startin interfaceLifecycleService
-
pause
Description copied from interface:LifecycleServiceTemporary halt the execution of this service.- Specified by:
pausein interfaceLifecycleService- Throws:
SWorkException
-
resume
public void resume()Description copied from interface:LifecycleServiceresume the execution the service- Specified by:
resumein interfaceLifecycleService
-
isStopped
public boolean isStopped()- Specified by:
isStoppedin interfaceWorkExecutorService
-
notifyNodeStopped
- Specified by:
notifyNodeStoppedin interfaceWorkExecutorService
-