[Groovy] Class ThreadInterruptibleASTTransformation
- org.codehaus.groovy.transform.ThreadInterruptibleASTTransformation
@GroovyASTTransformation(phase: CompilePhase.CANONICALIZATION) @CompileStatic class ThreadInterruptibleASTTransformation extends AbstractInterruptibleASTTransformation
Allows "interrupt-safe" executions of scripts by adding Thread.currentThread().isInterrupted() checks on loops (for, while, do) and first statement of closures. By default, also adds an interrupt check statement on the beginning of method calls.
- See Also:
- ThreadInterrupt
- Since:
- 1.8.0
Fields inherited from class | Fields |
---|---|
class AbstractInterruptibleASTTransformation | CHECK_METHOD_START_MEMBER, THROWN_EXCEPTION_TYPE, applyToAllClasses, applyToAllMembers, checkOnMethodStart, source, thrownExceptionType |
Constructor Summary
Constructor and description |
---|
ThreadInterruptibleASTTransformation
() |
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
protected Expression |
createCondition() | |
protected String |
getErrorMessage() | |
protected ClassNode |
type() | |
void |
visitClosureExpression(ClosureExpression closureExpr) | |
void |
visitMethod(MethodNode node) |
Inherited Methods Summary
Constructor Detail
ThreadInterruptibleASTTransformation()
Method Detail
protected Expression createCondition()
protected String getErrorMessage()
protected ClassNode type()
@Override void visitClosureExpression(ClosureExpression closureExpr)
@Override void visitMethod(MethodNode node)
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/3.0.7/html/gapi/org/codehaus/groovy/transform/ThreadInterruptibleASTTransformation.html