Which of the following statements regarding an enterprise bean's environment are correct? [Check all correct answers]
1. The container provides the tools that allow the deployer to create and manage the enterprise bean's environment.
2. Enterprise bean instances can modify the values of the environment entries at runtime.
3. The deployer sets and modifies the values of the environment entries by editing the enterprise bean's deployment descriptor.
4. Enterprise bean instances obtain the values of the environment entries from the enterprise bean's deployment descriptor.
5. Enterprise bean instances use the JNDI interfaces to obtain the values of the environment entries.
trupti nigam
Ranch Hand
Joined: Jun 21, 2001
Posts: 602
posted
0
I think 4 is correct. Answer 3 can also be correct as the <env-entry-value> can be set by either an application assembler or a deployer.
so i think 3 and 4 are correct.
thanks, trupti
mini mehta
Ranch Hand
Joined: Oct 22, 2000
Posts: 120
posted
0
Originally posted by trupti nigam: I think 4 is correct. Answer 3 can also be correct as the <env-entry-value> can be set by either an application assembler or a deployer.
Answer 2 is incorrect because enterprise bean instances can only read the values of the environment entries at runtime and are not able to modify them. Answers 3 and 4 are incorrect because the deployment descriptor is used to define only the environment entries, as opposed to the values that the enterprise bean expects to be provided at runtime.
Sujatha Kumar
Ranch Hand
Joined: Jan 05, 2004
Posts: 134
posted
0
Answer 3 may be wrong because it is the bean provider who defines the values for <env-entry>
But answer 4 should be correct. I feel even 1 is correct.
guys share your opinions???
SCJP,SCWCD,SCBCD,SCEA Part I
Sujatha Kumar
Ranch Hand
Joined: Jan 05, 2004
Posts: 134
posted
0
to conclude 1,4 and 5 are correct answers
Alex Sharkoff
Ranch Hand
Joined: Apr 11, 2004
Posts: 209
posted
0
Hi all,
4. Enterprise bean instances obtain the values of the environment entries from the enterprise bean's deployment descriptor.
I think 4 is incorrect because Enterprise bean instances do not obtain the values of the environment entries from the enterprise bean's deployment descriptor but rather from the its special environment (i.e. its jndi subcontext "java:comp/env"). Environment entries are defined in the deployment descriptor, once ejb-jar is deployed into the app server environment entries get associated with the jndi names, and these are the names that ejb instances use to look environment entry value up.
3. The deployer sets and modifies the values of the environment entries by editing the enterprise bean's deployment descriptor.
I think 3 is a correct answer as deployer must ensure that <env-entry-value> contains a legal value. Please see paragraph 20.2.3 on page 415
All right, my answers to this question would be 1, 3 and 5.
Alex (SCJP 1.4, SCBCD 1.3, SCWCD 1.4, SCJD 1.4)
mini mehta
Ranch Hand
Joined: Oct 22, 2000
Posts: 120
posted
0
Originally posted by Sujatha Kumar: to conclude 1,4 and 5 are correct answers
20.2 Enterprise Bean�s Environment as a JNDI Naming Context 3. The Deployer uses the tools provided by the container to create the environment entries that are declared in the enterprise bean�s deployment descriptor. The Deployer can set and modify the values of the environment entries.
Thanks
-- Ravi
SCJP, SCJD, SCWCD, SCBCD, SCEA
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.