Under the traditional J2EE/EJB 2.x packaging convention for a single…
2018
Under the traditional J2EE/EJB 2.x packaging convention for a single enterprise bean with a remote client view, the EJB class is accompanied by —
Answer: C. two accompanying interfaces and one XML file — ConceptIn the EJB 2.x component model, client access is separated into two contracts: a home interface handles creation and lookup, while a component…
- A.
one accompanying interface and one XML file
- B.
one accompanying interface and two XML files
- C.
two accompanying interfaces and one XML file
- D.
two accompanying interfaces and two XML files
Attempted by 351 students.
Show answer & explanation
Correct answer: C
Concept
In the EJB 2.x component model, client access is separated into two contracts: a home interface handles creation and lookup, while a component interface (remote or local) exposes business methods. Deployment metadata is collected in one ejb-jar.xml descriptor.
Application
Treat the interface count and XML descriptor count independently, then match each count to the EJB 2.x structure.
Component | Role in the model | Count |
|---|---|---|
Home interface | Creation and lookup of bean references | 1 |
Remote or local component interface | Access to the bean business methods | 1 |
ejb-jar.xml deployment descriptor | Deployment metadata for the enterprise bean | 1 |
Contrast
one accompanying interface and one XML file: one client contract does not represent both interface roles in the EJB 2.x model.
one accompanying interface and two XML files: the interface count and the descriptor count both differ from the EJB 2.x packaging model.
two accompanying interfaces and one XML file: the two client contracts and the single deployment descriptor align with the EJB 2.x model.
two accompanying interfaces and two XML files: the interface count reflects the two client contracts, while the descriptor count adds an extra XML file.
Cross-check
Counting the standard artifacts gives one home interface plus one remote or local component interface, for two interfaces in total, and one ejb-jar.xml deployment descriptor.
Result
Therefore, in the traditional EJB 2.x model, the matching value is two accompanying interfaces and one XML file.
A video solution is available for this question — log in and enroll to watch it.