简体   繁体   中英

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

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

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

3) Can @Priority be overwritten in xml file ?

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 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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM