I came across the following statements in a mock exam. 1. The deployer sets and modifies the values of the environment entries by editing the enterprise bean's deployment descriptor. 2. Enterprise bean instances obtain the values of the environment entries from the enterprise bean's deployment descriptor. Answer given: Both the statements are false. Why is it so? I thought the deployer is responsible for setting the values of the environment entries and that the bean instances obtain these values from the deployment descriptor.
For the first question. Even the Bean provider can set the values of the environment entries. But it is the responsibility of the Deployer to make sure that the values are present Dilli [ February 18, 2004: Message edited by: Dilli raj ]
1. Definitely wrong. The bean provider adds the initial env-entries to the descriptor. The application assembler modifies their values. I'd argue that there isn't a deployer responsibility here at all, at least not from the standpoint of being examined on the spec. From a software engineering workflow standpoint, yes, it would be good for the deployer to know what was supposed to be in the descriptor, and throw the ejb-jar back in the lap of the application assembler if something is missing, but the spec isn't testing us on our ideas for ways to create a deployment workflow with appropriate safeguards. The exam simply wants us to know the conceptual responsibilities of the various roles. 2 Definitely wrong. The bean gets the environment values via JNDI, not via the deployment descriptor. The container uses the deployment descriptor to populate the bean's private JNDI context, but the bean is oblivious to how that is done.
Reid - SCJP2 (April 2002)
The only cure for that is hours of television radiation. And this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!