/*
* Copyright 2008-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package griffon.transform;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* <p>Annotates a class.</p>
* <p/>
* <p>When annotating a class it indicates that it will be able to
* execute code using the Application's threading facilities.</p>
* <p/>
* The following methods will be added to classes annotated with @ThreadingAware
* <ul>
* <li><code>public boolean isUIThread()</code></li>
* <li><code>public void runInsideUIAsync(Runnable runnable)</code></li>
* <li><code>public void runInsideUISync(Runnable runnable)</code></li>
* <li><code>public void runOutsideUI(Runnable runnable)</code></li>
* <li><code>public <R> Future<R> runFuture(ExecutorService executorService, Callable<R> callable)</code></li>
* <li><code>public <R> Future<R> runFuture(Callable<R> callable)</code></li>
* <li><code>public <R> R runInsideUISync(Callable<R> callable)</code></li>
* <li><code>public <R> R runOutsideUI(Callable<R> callable)</code></li>
* </ul>
*
* @author Andres Almiray
* @see griffon.core.threading.ThreadingHandler
* @since 2.0.0
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@Target({ElementType.TYPE})
public @interface ThreadingAware {
}