Search your topic in Java2share
Home > SCBCD > SCBCD Question Bank
eXTReMe Tracker


2. General EJB 3.0 Enterprise Bean Knowledge (SCBCD)

 Q: 1 Which is a valid PostConstruct method in a message-driven bean class?
A. @PostConstruct
public boolean init() { return true; }
B. @PostConstruct
private static void init() {}
C. @PostConstruct
private void init() {}
D. @PostConstruct
public static void init() {}

Answer: C

Q: 02 A developer is working on a project that includes both EJB 2.1 and EJB 3.0
session beans. A lot of business logic has been implemented and tested in these EJB 2.1 session beans.
Some EJB 3.0 session beans need to access this business logic.
Which design approach can achieve this requirement?

A. Add adapted home interfaces to EJB 3.0 session beans to make EJB 3.0 and EJB 2.1 session beans
interoperable.
B. Add EJB 3.0 business interfaces to existing EJB 2.1 session beans and inject references to these business
interfaces into EJB 3.0 session beans.
C. No need to modify existing EJB 2.1 session beans. Use the @EJB annotation to inject a reference to the
EJB 2.1 home interface into the EJB 3.0 bean class.
D. No need to modify existing EJB 2.1 session beans. Use the @EJB annotation to inject a reference to the
EJB 2.1 component interface into the EJB 3.0 bean class.

Answer: C

 Q: 03 Which two are programming restrictions in the EJB 3.0 specification?
(Choose two.)

A. An enterprise bean must NOT attempt to load a native library.
B. An enterprise bean must NOT declare static fields as final.
C. An enterprise bean must NOT attempt to create a new security manager.
D. An enterprise bean must NOT propagate a RuntimeException to the container.
E. An enterprise bean must NOT attempt to obtain a javax.naming.InitialContext.

Answer: A, C

Q: 04 Which statement is true about the Timer service in an EJB 3.0 stateless
session bean?

A. The timeout callback method contains the business logic that handles the timeout event.
B. The timeout callback method must be declared as a business method in business interfaces.
C. The timeout callback method can throw application exceptions to report business logic failures.
D. A bean class can implement multiple timeout callback methods, each associated with a different timer.

Answer: A