为了账号安全,请及时绑定邮箱和手机立即绑定

【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 关注
  • 5431 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信