亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

【Spring】@Async("參數")的參數是什么意思

【Spring】@Async("參數")的參數是什么意思

慕碼人2483693 2018-10-28 17:13:36
如題,不知道這個注解里的參數是干什么用的 public @interface Async {     /**      * A qualifier value for the specified asynchronous operation(s).      * <p>May be used to determine the target executor to be used when executing this      * method, matching the qualifier value (or the bean name) of a specific      * {@link java.util.concurrent.Executor Executor} or      * {@link org.springframework.core.task.TaskExecutor TaskExecutor}      * bean definition.      * <p>When specified on a class level {@code @Async} annotation, indicates that the      * given executor should be used for all methods within the class. Method level use      * of {@code Async#value} always overrides any value set at the class level.      * @since 3.1.2      */     String value() default ""; }
查看完整描述

2 回答

?
臨摹微笑

TA貢獻1982條經驗 獲得超2個贊

用于指定使用哪一個線程池執行

查看完整回答
反對 回復 2018-11-03
?
互換的青春

TA貢獻1797條經驗 獲得超6個贊

642/5000

/ * *

*指定異步操作的限定符值。

*

可用于確定執行此操作時要使用的目標執行程序

方法,匹配特定的限定符值(或bean名稱)

  • { @link java . util . concurrent。遺囑執行人執行人}或

  • { @link org.springframework.core.task。TaskExecutor TaskExecutor }

  • bean定義。

*

當在類級別{@code @Async}注釋中指定時,表示

*給定的executor應該用于類中的所有方法。方法級使用

*的{@code async#值}總是覆蓋在類級別上設置的任何值。

  • @since 3.1.2

  • /



查看完整回答
反對 回復 2018-11-03
  • 2 回答
  • 0 關注
  • 5550 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號