A developer writes an interceptor class and a stateless session bean:
A client acquires an EJB reference to the FooLocal business interface and invokes the foo()
method one time. Which describes the output?
A.
Foo FooInt AInt
B.
AInt Foo
C.
AInt FooInt Foo
D.
FooInt AInt Foo
Explanation:
*At the end of the chain of interceptors, the actual bean method gets called.
*Interceptors can be bound in three different ways:
Default
Class level
Method level
In this question both class level and method level interceptors are used.
The class level interceptor intercepts before the method-level interceptor.
Note:
*Interceptors are used in conjunction with Java EE managed classes to allow developers to invokeinterceptor methods on an associated target class, in conjunction with method invocations or
lifecycle events. Common uses of interceptors are logging, auditing, and profiling.
*An interceptor can be defined within a target class as an interceptor method, or in an associated
class called an interceptor class. Interceptor classes contain methods that are invoked in
conjunction with the methods or lifecycle events of the target class.
Interceptor classes and methods are defined using metadata annotations, or in the deployment
descriptor of the application containing the interceptors and target classes.
*javax.interceptor.AroundInvoke
Designates the method as an interceptor method.
*The target class can have any number of interceptor classes associated with it. The order in
which the interceptor classes are invoked is determined by the order in which the interceptor
classes are defined in the javax.interceptor.Interceptors annotation.
Reference:Introduction to EJB3 Interceptors
Reference:The Java EE 6 Tutorial,Overview of Interceptors