View Javadoc

1   /*
2    * Copyright 2004-2008 the Seasar Foundation and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
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, 
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.seasar.uruma.annotation;
17  
18  import java.lang.annotation.ElementType;
19  import java.lang.annotation.Retention;
20  import java.lang.annotation.RetentionPolicy;
21  import java.lang.annotation.Target;
22  
23  /**
24   * UI スレッドとは非同期に実行するメソッドを指定するためのアノテーションです。<br />
25   * メソッドバインディング対象のメソッドに本アノテーションを指定すると、そのメソッドを Uruma
26   * が呼び出す際、UIスレッドとは異なるスレッドで非同期に呼び出します。
27   * 主に時間のかかる処理を実行するメソッドに対して指定すると、メソッドを実行している間にも画面を操作することができます。<br />
28   * 
29   * @author y-komori
30   */
31  @Retention(RetentionPolicy.RUNTIME)
32  @Target( { ElementType.METHOD })
33  public @interface AsyncMethod {
34      /**
35       * タスク名称を表すプロパティ名を指定します。<br />
36       * 
37       * @return プロパティ名
38       */
39      String nameProperty() default "";
40  
41      /**
42       * キャンセル可能なタスクかどうかを指定します。<br />
43       * 
44       * @return <code>true</code> の場合、キャンセル可能。そうでない場合不可能。
45       */
46      boolean cancelable() default true;
47  }