01 /*
02 * Copyright 2008-2014 the original author or authors.
03 *
04 * Licensed under the Apache License, Version 2.0 (the "License");
05 * you may not use this file except in compliance with the License.
06 * You may obtain a copy of the License at
07 *
08 * http://www.apache.org/licenses/LICENSE-2.0
09 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package griffon.transform;
17
18 import java.lang.annotation.*;
19
20 /**
21 * <p>Annotates a class.</p>
22 * <p/>
23 * <p>When annotating a class it indicates that it will be able to
24 * execute code using the Application's threading facilities.</p>
25 * <p/>
26 * The following methods will be added to classes annotated with @ThreadingAware
27 * <ul>
28 * <li><code>public boolean isUIThread()</code></li>
29 * <li><code>public void runInsideUIAsync(Runnable runnable)</code></li>
30 * <li><code>public void runInsideUISync(Runnable runnable)</code></li>
31 * <li><code>public void runOutsideUI(Runnable runnable)</code></li>
32 * <li><code>public Future runFuture(ExecutorService executorService, Callable callable)</code></li>
33 * <li><code>public Future runFuture(Callable callable)</code></li>
34 * </ul>
35 *
36 * @author Andres Almiray
37 * @see griffon.core.threading.ThreadingHandler
38 * @since 2.0.0
39 */
40 @Documented
41 @Retention(RetentionPolicy.SOURCE)
42 @Target({ElementType.TYPE})
43 public @interface ThreadingAware {
44 }
|