Question | Answer |
May be defined on which EJB type(s) | Session bean and message driven beans. |
Intercept which method types. | Session bean business methods and message driven bean's message listener methods. |
Location of interceptor methods. | In special interceptor class, interceptor superclass, or in the target class. |
Restrinctions on interceptor methods. | At most one per class. |
Annotation(s) use to define interceptor method(s) | |
Interceptor method security context. | Same security context as intercepted business method. |
Interceptor method transaction context. | Same transaction context as intercepted business method. |
Exceptions interceptor methods may throw. | Exceptions declared in the throws-clause of the intercepted business method and system exceptions. |
Interceptor method signature. | Object someMethodName(InvocationContext) throws Exception 其中,「someMethodName」為開發者自取的方法名稱; 「InvocationContext」類別在,「javax.interceptor」套件中。 |
Interceptor method visibility | Public, protected, private or package visibility |
節錄自:http://www.slideshare.net/krizsan/ocp-jbcd-6-study-notes,p.109
沒有留言:
張貼留言