|
Griffon 0.9.5-rc2 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
java.lang.Objectgriffon.transform.Threading
@Retention(RetentionPolicy.SOURCE) @Target({ElementType.METHOD, ElementType.FIELD}) @GroovyASTTransformationClass("org.codehaus.griffon.ast.ThreadingASTTransformation") public @interface Threading
Annotates a method or property.
Annotated elements must follow these rules
The following snippet exemplifies the compactness of code when the annotation is applied
import griffon.transform.Threading class Sample { @Threading void doSomethingOutside(String arg) { println "Outside $arg" } @Threading(Threading.Policy.INSIDE_UITHREAD_SYNC) void doSomethingInside(String arg) { println "Inside $arg" } }
The equivalent, non-annotated code is
import griffon.core.UIThreadManager class Sample { void doSomethingOutside(String arg) { UIThreadManager.instance.executeOutside { println "Outside $arg" } } void doSomethingInside(String arg) { UIThreadManager.instance.executeSync { println "Inside $arg" } } }
Nested Class Summary | |
---|---|
enum |
Threading.Policy
Indicates the type of threading management for a method or property. |
Optional Element Summary | |
---|---|
null |
value
@default Policy.OUTSIDE_UITHREAD |
Method Summary | |
---|---|
Threading
|
valueOf(String name)
Returns the enum constant of this type with the specified name. |
Threading[]
|
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Element Detail |
---|
Threading.Policy value
Method Detail |
---|
Threading valueOf(String name)
Threading[] values()
Groovy Documentation