|
Griffon 1.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.griffon.ast.AbstractASTTransformation
org.codehaus.griffon.ast.ThreadingASTTransformation
@GroovyASTTransformation(phase = CompilePhase.CANONICALIZATION) public class ThreadingASTTransformation extends AbstractASTTransformation
Handles generation of code for the @Threading annotation.
Field Summary | |
---|---|
private static String |
COMPILER_THREADING_KEY
|
static String |
EXECUTE_ASYNC
|
static String |
EXECUTE_FUTURE
|
static String |
EXECUTE_OUTSIDE
|
static String |
EXECUTE_SYNC
|
private static Logger |
LOG
|
private static ClassNode |
MY_TYPE
|
private static ClassNode |
UITHREAD_MANAGER_CLASS
|
Fields inherited from class AbstractASTTransformation | |
---|---|
APPLICATION_HOLDER_TYPE, COLLECTIONS_CLASS |
Constructor Summary | |
ThreadingASTTransformation()
|
Method Summary | |
---|---|
static String
|
getThreadingMethod(AnnotatedNode node)
|
static String
|
getThreadingMethod(Policy threadingPolicy)
|
static Policy
|
getThreadingPolicy(AnnotationNode annotation)
|
static void
|
handleFieldForInjection(ClassNode classNode, FieldNode field)
|
static void
|
handleFieldForInjection(ClassNode classNode, FieldNode field, String threadingMethod)
|
static void
|
handleMethodForInjection(ClassNode classNode, MethodNode method)
|
static void
|
handleMethodForInjection(ClassNode classNode, MethodNode method, String threadingMethod)
|
static void
|
handlePropertyForInjection(ClassNode classNode, PropertyNode property)
|
static void
|
handlePropertyForInjection(ClassNode classNode, PropertyNode property, String threadingMethod)
|
static boolean
|
hasThreadingAnnotation(AnnotatedNode node)
Convenience method to see if an annotated node is @Threading. |
private static boolean
|
hasVoidOrDefAsReturnType(MethodNode method)
|
private static void
|
makeVariablesShared(VariableScope scope)
|
private static MethodDescriptor
|
methodDescriptorFor(MethodNode method)
|
static boolean
|
skipInjection(String actionName)
|
private static Expression
|
uiThreadManagerInstance()
|
private static boolean
|
usesThreadingAlready(Statement stmnt)
|
void
|
visit(ASTNode[] nodes, SourceUnit source)
Handles the bulk of the processing, mostly delegating to other methods. |
private static boolean
|
wrapClosure(ClosureExpression closure, String threadingMethod)
|
private static void
|
wrapStatements(ClassNode declaringClass, MethodNode method, String threadingMethod)
|
private static void
|
wrapStatements(ClassNode declaringClass, PropertyNode property, String threadingMethod)
|
private static void
|
wrapStatements(ClassNode declaringClass, FieldNode field, String threadingMethod)
|
private static Statement
|
wrapStatements(Statement code, String threadingMethod)
|
Methods inherited from class AbstractASTTransformation | |
---|---|
addError, applicationInstance, checkNodesForAnnotationAndType, emptyMap, makeClassSafe, makeClassSafe, makeClassSafe, newClass |
Field Detail |
---|
private static final String COMPILER_THREADING_KEY
public static final String EXECUTE_ASYNC
public static final String EXECUTE_FUTURE
public static final String EXECUTE_OUTSIDE
public static final String EXECUTE_SYNC
private static final Logger LOG
private static ClassNode MY_TYPE
private static ClassNode UITHREAD_MANAGER_CLASS
Constructor Detail |
---|
ThreadingASTTransformation()
Method Detail |
---|
public static String getThreadingMethod(AnnotatedNode node)
public static String getThreadingMethod(Policy threadingPolicy)
public static Policy getThreadingPolicy(AnnotationNode annotation)
public static void handleFieldForInjection(ClassNode classNode, FieldNode field)
public static void handleFieldForInjection(ClassNode classNode, FieldNode field, String threadingMethod)
public static void handleMethodForInjection(ClassNode classNode, MethodNode method)
public static void handleMethodForInjection(ClassNode classNode, MethodNode method, String threadingMethod)
public static void handlePropertyForInjection(ClassNode classNode, PropertyNode property)
public static void handlePropertyForInjection(ClassNode classNode, PropertyNode property, String threadingMethod)
public static boolean hasThreadingAnnotation(AnnotatedNode node)
node
- the node to check
private static boolean hasVoidOrDefAsReturnType(MethodNode method)
private static void makeVariablesShared(VariableScope scope)
private static MethodDescriptor methodDescriptorFor(MethodNode method)
public static boolean skipInjection(String actionName)
private static Expression uiThreadManagerInstance()
private static boolean usesThreadingAlready(Statement stmnt)
public void visit(ASTNode[] nodes, SourceUnit source)
nodes
- the ast nodessource
- the source unit for the nodes
private static boolean wrapClosure(ClosureExpression closure, String threadingMethod)
private static void wrapStatements(ClassNode declaringClass, MethodNode method, String threadingMethod)
private static void wrapStatements(ClassNode declaringClass, PropertyNode property, String threadingMethod)
private static void wrapStatements(ClassNode declaringClass, FieldNode field, String threadingMethod)
private static Statement wrapStatements(Statement code, String threadingMethod)
Groovy Documentation