nerdexam
Oracle

1Z0-895 · Question #83

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…

The correct answer is C. AInt FooInt Foo. At the end of the chain of interceptors, the actual bean method gets called. Interceptors can be bound in three different ways: In this question both class level and method level interceptors are used. The class level interceptor intercepts before the method-level interceptor…

Interceptors

Question

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?

Exhibit

1Z0-895 question #83 exhibit

Options

  • AFoo FooInt AInt
  • BAInt Foo
  • CAInt FooInt Foo
  • DFooInt AInt Foo

How the community answered

(47 responses)
  • A
    13% (6)
  • B
    4% (2)
  • C
    77% (36)
  • D
    6% (3)

Explanation

*At the end of the chain of interceptors, the actual bean method gets called. *Interceptors can be bound in three different ways: In this question both class level and method level interceptors are used. The class level interceptor intercepts before the method-level interceptor. *Interceptors are used in conjunction with Java EE managed classes to allow developers to invoke interceptor 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. Introduction to EJB3 Interceptors The Java EE 6 Tutorial,Overview of Interceptors

Topics

#interceptor ordering#AroundInvoke#class-level interceptors#method-level interceptors

Community Discussion

No community discussion yet for this question.

Full 1Z0-895 Practice