@Priority对于CDI @Interceptor是什么意思? [英] What is the meaning of @Priority for CDI @Interceptor?

查看:249
本文介绍了@Priority对于CDI @Interceptor是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1)@Priority对于CDI @Interceptor是什么意思?

1) What is the meaning of @Priority for CDI @Interceptor ?

2)它与beans.xml中声明的拦截器的顺序有什么关系?

2) How does it relate to order of interceptors declared in beans.xml ?

3)可以在xml文件中覆盖@Priority吗?

3) Can @Priority be overwritten in xml file ?

推荐答案

1嗯,顾名思义,它意味着为Java EE应用程序中的拦截器设置优先级(顺序)。此类拦截器也将自动注册,因此您无需在 beans.xml 中定义它。

1) Well, as the name suggests, it's meant to set priority (order) to the interceptors within Java EE application. Such interceptor will also be automatically registered so you don't have to define it in beans.xml.

2 ,3)JBoss 文档说在 beans.xml 中定义之前调用 @Priority 之前调用的拦截器。因此,覆盖没有任何意义,因为已经定义了顺序,并且您无法在 beans.xml 中关闭拦截器(您可以跳过声明)。

2, 3) JBoss documentation says that interceptors annotated with @Priority ale called before ones defined in beans.xml. Thus overwriting doesn't make any sense because order is already defined and you cannot turn off interceptors in beans.xml (you just can skip the declaration).

这篇关于@Priority对于CDI @Interceptor是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆