Oracle
1Z0-895 · Question #91
A developer writes an interceptor class containing an AroundInvoke method, and applies it to the local business interface method of a stateless session bean: 11. @Interceptors(FooInterceptor.class)…
The correct answer is B. 2. You can specify one nonbusiness method as the interceptor method for a stateless or stateful session bean. Each time a client invokes a session bean business method, OC4J intercepts the invocation and invokes the interceptor method. Reference: Configuring an Around Invoke…
Interceptors
Question
A developer writes an interceptor class containing an AroundInvoke method, and applies it to the local business interface method of a stateless session bean: 11. @Interceptors(FooInterceptor.class) 12. public void bar() () A client obtains a reference to the bean's local business interface, and calls the method bar two times from the same thread. Assuming that the container dispatches both cell to the same stateless session bean instance, how many instances of the FooInterceptor class will be used?
Options
- A0
- B2
- C1
- DEither 1 or 2
How the community answered
(48 responses)- A6% (3)
- B77% (37)
- C2% (1)
- D15% (7)
Explanation
You can specify one nonbusiness method as the interceptor method for a stateless or stateful session bean. Each time a client invokes a session bean business method, OC4J intercepts the invocation and invokes the interceptor method. Reference: Configuring an Around Invoke Interceptor Method on an EJB 3.0 Session Bean
Topics
#interceptor lifecycle#stateless session bean#interceptor instances#AroundInvoke
Community Discussion
No community discussion yet for this question.