Amazon Ads

2013年8月23日 星期五

[筆記]Business Method Interceptor的一些特性

下表列出Business Method Interceptor的一些特性:
QuestionAnswer
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)@AroundLinvoke

在「javax.interceptor」套件中
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 visibilityPublic, protected, private or package visibility

節錄自:http://www.slideshare.net/krizsan/ocp-jbcd-6-study-notes,p.109

沒有留言: