@DisallowConcurrentExecution public class ScheduledRecoveryManager<ID> extends Object implements RecoveryManager<ExceptionResolver,FlowInvocationContext,ID>, org.quartz.Job, IsExclusionServiceAware, IsErrorReportingServiceAware, IsConsumerAware
| Constructor and Description |
|---|
ScheduledRecoveryManager(org.quartz.Scheduler scheduler,
ScheduledJobFactory scheduledJobFactory,
String flowName,
String moduleName)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(ID identifier) |
void |
cancelAll()
Cancel an in progress recovery.
|
void |
execute(org.quartz.JobExecutionContext context)
Callback from the scheduler.
|
protected FinalAction |
getFinalAction(ExceptionAction exceptionAction) |
ExceptionResolver |
getResolver()
Get the specific exception resolver
|
void |
initialise() |
boolean |
isRecovering()
Are we currently running an active recovery.
|
boolean |
isUnrecoverable()
Is the situation unrecoverable.
|
protected org.quartz.Trigger |
newRecoveryTrigger(long delay)
Factory method for creating a new recovery trigger.
|
protected org.quartz.Trigger |
newRecoveryTrigger(String cronExpression)
Factory method for creating a new recovery trigger.
|
protected void |
recover(ExceptionAction action,
String componentName,
Throwable throwable,
ID id)
Common resolution of the action for the componentName and throwable instance
|
<T> void |
recover(FlowInvocationContext flowInvocationContext,
Throwable throwable,
T event,
ID identifier)
Execute recovery based on the specified flowInvocationContext, exception, event and event identifier.
|
void |
recover(String componentName,
Throwable throwable)
Execute recovery based on the specified component name and exception.
|
void |
setConsumer(Consumer consumer) |
void |
setErrorReportingService(ErrorReportingService errorReportingService) |
void |
setExclusionService(ExclusionService exclusionService) |
<L> void |
setManagedResources(L managedResources) |
void |
setResolver(ExceptionResolver exceptionResolver)
Set a specific exception resolver
|
protected void |
startManagedResources()
Start the components marked as including Managed Resources.
|
protected void |
stopManagedResources() |
public ScheduledRecoveryManager(org.quartz.Scheduler scheduler,
ScheduledJobFactory scheduledJobFactory,
String flowName,
String moduleName)
scheduler - the SchedulerscheduledJobFactory - a ScheduledJobFactoryflowName - the name of the flow to which this manager is attachedmoduleName - the module namepublic void setResolver(ExceptionResolver exceptionResolver)
setResolver in interface RecoveryManager<ExceptionResolver,FlowInvocationContext,ID>exceptionResolver - an ExceptionResolverpublic ExceptionResolver getResolver()
getResolver in interface RecoveryManager<ExceptionResolver,FlowInvocationContext,ID>public boolean isRecovering()
isRecovering in interface RecoveryManager<ExceptionResolver,FlowInvocationContext,ID>protected void recover(ExceptionAction action, String componentName, Throwable throwable, ID id)
action - the given ExceptionActioncomponentName - the name of the component that threw the original exceptionthrowable - the exception that was thrownid - the identifier of the FlowEventpublic void recover(String componentName, Throwable throwable)
recover in interface RecoveryManager<ExceptionResolver,FlowInvocationContext,ID>componentName - the name of the component that threw the exception (usually the consumer)throwable - the exceptionpublic <T> void recover(FlowInvocationContext flowInvocationContext, Throwable throwable, T event, ID identifier)
recover in interface RecoveryManager<ExceptionResolver,FlowInvocationContext,ID>T - flowInvocationContext - throwable - event - identifier - protected FinalAction getFinalAction(ExceptionAction exceptionAction)
public boolean isUnrecoverable()
isUnrecoverable in interface RecoveryManager<ExceptionResolver,FlowInvocationContext,ID>public void cancelAll()
cancelAll in interface RecoveryManager<ExceptionResolver,FlowInvocationContext,ID>public void cancel(ID identifier)
cancel in interface RecoveryManager<ExceptionResolver,FlowInvocationContext,ID>public void initialise()
initialise in interface RecoveryManager<ExceptionResolver,FlowInvocationContext,ID>protected org.quartz.Trigger newRecoveryTrigger(long delay)
delay - protected org.quartz.Trigger newRecoveryTrigger(String cronExpression)
cronExpression - public void execute(org.quartz.JobExecutionContext context)
throws org.quartz.JobExecutionException
execute in interface org.quartz.Jobcontext - the jbo execution contextorg.quartz.JobExecutionExceptionprotected void stopManagedResources()
protected void startManagedResources()
public <L> void setManagedResources(L managedResources)
setManagedResources in interface RecoveryManager<ExceptionResolver,FlowInvocationContext,ID>public void setExclusionService(ExclusionService exclusionService)
setExclusionService in interface IsExclusionServiceAwarepublic void setErrorReportingService(ErrorReportingService errorReportingService)
setErrorReportingService in interface IsErrorReportingServiceAwarepublic void setConsumer(Consumer consumer)
setConsumer in interface IsConsumerAwareCopyright © 2007-2019 Ikasan. All Rights Reserved.