What are Interceptors in Java EE?

前端 未结 3 919
旧时难觅i
旧时难觅i 2021-01-30 03:55

I\'m trying to clear my concept about Interceptors in Java EE. I have read Java EE specification but I\'m little confused about it. Please provide me some useful link or tutoria

3条回答
  •  余生分开走
    2021-01-30 04:36

    I like this definition: Interceptors are components that intercept calls to EJB methods. They can be used for auditing and logging as and when EJBs are accessed.

    In another situation, they can be used in a situation where we need to check whether a client has the authority or clearance to execute a transaction on a particular object in the database. Well, this is where Interceptors come in handy; they can check whether the client/user has that authority by checking whether he/she can invoke that method on that database object or EJB.

    However, I would still have a look at the following article and the following tutorial to get an idea of how they are used in a Java EE setting/environment.

提交回复
热议问题