Distributed Objects   «Prev  Next»

EJB container Services - Quiz

1. Which of the following are services provided by the Jakarta EE 11 container to CDI managed beans?
Please select all the correct answers.
  A. Dependency injection via @Inject
  B. Bean lifecycle management based on scope
  C. JNDI stub generation for remote method calls
  D. Method interception via interceptors

2. In Jakarta EE 11, when BeanA is injected into BeanB using @Inject, how does BeanB invoke methods on BeanA?
Please select the best answer.
  A. BeanB calls new BeanA() directly to obtain an instance
  B. BeanB calls methods on the container-provided proxy for BeanA
  C. BeanB performs a JNDI lookup to obtain a stub for BeanA
  D. BeanB communicates with BeanA over a network socket

3. Which of the following are valid container activities when a CDI interceptor-bound method is invoked in Jakarta EE 11?
Please select all the correct answers.
  A. Begin a transaction if @Transactional is declared on the method
  B. Enforce security constraints declared via @RolesAllowed
  C. Invoke registered interceptor methods before the bean method executes
  D. Silently discard the request if the client lacks the required role
  E. Bypass the interceptor chain and invoke the bean method directly