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 java.lang.Object implements WorkExecutorService, WorkExecutionCallback
- Author:
- Baptiste Mesta.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNUMBER_OF_WORKS_RETRIEDintnumberOfFramesToLogInExceptions
-
Constructor Summary
Constructors Constructor Description RetryingWorkExecutorService(BonitaExecutorServiceFactory bonitaExecutorServiceFactory, EngineClock engineClock, long workTerminationTimeout, int maxRetry, int delay, double delayFactor, ExceptionRetryabilityEvaluator exceptionRetryabilityEvaluator, WorkExecutionAuditor workExecutionAuditor, io.micrometer.core.instrument.MeterRegistry meterRegistry, IncidentService incidentService, long tenantId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(WorkDescriptor work)voidhandleFailure(WorkDescriptor work, BonitaWork bonitaWork, java.util.Map<java.lang.String,java.lang.Object> context, java.lang.Throwable thrown)booleanisStopped()voidnotifyNodeStopped(java.lang.String nodeName)voidonFailure(WorkDescriptor work, BonitaWork bonitaWork, java.util.Map<java.lang.String,java.lang.Object> context, java.lang.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, wait
-
Methods inherited from interface org.bonitasoft.engine.commons.TenantLifecycleService
init
-
-
-
-
Field Detail
-
NUMBER_OF_WORKS_RETRIED
public static final java.lang.String NUMBER_OF_WORKS_RETRIED
- See Also:
- Constant Field Values
-
numberOfFramesToLogInExceptions
public int numberOfFramesToLogInExceptions
-
-
Constructor Detail
-
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, @Value("${tenantId}") long tenantId)
-
-
Method Detail
-
setNumberOfFramesToLogInExceptions
@Value("${bonita.tenant.work.exceptionsNumberOfFrameToLog:3}") public void setNumberOfFramesToLogInExceptions(int numberOfFramesToLogInExceptions)
-
onSuccess
public void onSuccess(WorkDescriptor work)
- Specified by:
onSuccessin interfaceWorkExecutionCallback
-
onFailure
public void onFailure(WorkDescriptor work, BonitaWork bonitaWork, java.util.Map<java.lang.String,java.lang.Object> context, java.lang.Throwable thrown)
- Specified by:
onFailurein interfaceWorkExecutionCallback
-
handleFailure
public void handleFailure(WorkDescriptor work, BonitaWork bonitaWork, java.util.Map<java.lang.String,java.lang.Object> context, java.lang.Throwable thrown)
-
execute
public void execute(WorkDescriptor work)
- 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
public void pause() throws SWorkExceptionDescription 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
public void notifyNodeStopped(java.lang.String nodeName)
- Specified by:
notifyNodeStoppedin interfaceWorkExecutorService
-
-