Class StacktraceFingerprintingTaskRecoveryStrategy<E extends Exception>
java.lang.Object
org.springframework.cloud.dataflow.completion.StacktraceFingerprintingTaskRecoveryStrategy<E>
- All Implemented Interfaces:
RecoveryStrategy<E>
- Direct Known Subclasses:
ConfigurationPropertyValueHintTaskRecoveryStrategy
,UnfinishedConfigurationPropertyNameTaskRecoveryStrategy
public abstract class StacktraceFingerprintingTaskRecoveryStrategy<E extends Exception>
extends Object
implements RecoveryStrategy<E>
A recovery strategy that will trigger if the parser failure is similar to that of some
sample unfinished task definition. The match is decided by analyzing the top frames of
the stack trace emitted by the parser when it encounters the ill formed input. Multiple
fingerprints are supported, as the control flow in the parser code may be different
depending on the form of the expression. See
StacktraceFingerprintingRecoveryStrategy
.- Author:
- Eric Bottard, Andy Clement
-
Constructor Summary
ConstructorsConstructorDescriptionStacktraceFingerprintingTaskRecoveryStrategy
(Class<E> exceptionClass, String... samples) Construct a new StacktraceFingerprintingTaskRecoveryStrategy given the parser, and the expected exception class to be thrown for sample fragments of a task definition that is to be parsed. -
Method Summary
Modifier and TypeMethodDescriptionboolean
shouldTrigger
(String dslStart, Exception exception) Whether this completion should be triggered.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.cloud.dataflow.completion.RecoveryStrategy
addProposals
-
Constructor Details
-
StacktraceFingerprintingTaskRecoveryStrategy
Construct a new StacktraceFingerprintingTaskRecoveryStrategy given the parser, and the expected exception class to be thrown for sample fragments of a task definition that is to be parsed.- Parameters:
exceptionClass
- the expected exception that results from parsing the sample fragment stream definitions. Stack frames from the thrown exception are used to store the fingerprint of this exception thrown by the parser.samples
- the sample fragments of task definitions.
-
-
Method Details
-
shouldTrigger
Description copied from interface:RecoveryStrategy
Whether this completion should be triggered.- Specified by:
shouldTrigger
in interfaceRecoveryStrategy<E extends Exception>
- Parameters:
dslStart
- the partial DSL textexception
- the exception thrown when parsing the DSL text- Returns:
- if proposals to complete the DSL should be provided
-