1Z0-895 · Question #74
Which two are programming restrictions in the EJB specification? (Choose two.)
The correct answer is A. An enterprise bean must NOT attempt to load a native library. C. An enterprise bean must NOT attempt to create a new security manager. The following is a list of Java features that you should avoid, hence restricting their use in your EJB components' implementation code: (A)Loading native libraries. (C)Attempting to create or obtain a class loader, set or create a new security manager(C), stop the JVM, change…
Question
Options
- AAn enterprise bean must NOT attempt to load a native library.
- BAn enterprise bean must NOT declare static fields as final.
- CAn enterprise bean must NOT attempt to create a new security manager.
- DAn enterprise bean must NOT propagate a RuntimeException to the container.
- EAn enterprise bean must NOT attempt to obtain a javax.naming.InitialContext.
How the community answered
(37 responses)- A76% (28)
- B3% (1)
- D14% (5)
- E8% (3)
Explanation
The following is a list of Java features that you should avoid, hence restricting their use in your EJB components' implementation code: (A)Loading native libraries. (C)Attempting to create or obtain a class loader, set or create a new security manager(C), stop the JVM, change the input, output, and error streams. That restriction enforces security and maintains the EJB container's ability to manage the runtime environment. (not B)Using static, nonfinal fields. Declaring all static fields in the EJB component as final is recommended. That ensures consistent runtime semantics so that EJB containers have the flexibility to distribute instances across multiple JVMs. Reference: Programming restrictions on EJB
Topics
Community Discussion
No community discussion yet for this question.