File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Mock Exam Question(Repost) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Mock Exam Question(Repost)" Watch "Mock Exam Question(Repost)" New topic
Author

Mock Exam Question(Repost)

Rahul Mishra
Ranch Hand

Joined: Jan 22, 2006
Posts: 211
Which of the following statements regarding an enterprise bean's environment are correct?


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.
Answers 1 and 5 are correct.
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.

Can someone explain a bit in detail why 3 and 4 are wrong?...as far as i remember we specify even the values in Deployment Descriptor ...please have a look EJB specs - page 410 section 20.2 before answering


OCMJEA/SCEA, SCDJWS, SCBCD 1.3, SCJP 1.4
My SCEA experience:http://javalogue.blogspot.com/
Frederic Esnault
Ranch Hand

Joined: Feb 13, 2006
Posts: 284
Hi,

About answer 4, the bean doesn't get its env. values from the DD, but from its environment (JNDI). DD is used to create this environment.

But for point 3, I am surprised. The deployer has the right to set/modify values like this. May be the idea is that he uses the container tools, but this is not mandatory.

May I ask where you found this question?


SCJP 5 - SCWCD 1.4 - SCBCD 1.3 - Certification study documents/resources: http://esnault.frederic.free.fr/certification
k space
Ranch Hand

Joined: Jun 25, 2002
Posts: 104
My understanding of the spec 410 section 20.2

2. The Container provides an implementation of the JNDI naming context that stores the enterprise bean environment. The Container also provides the tools that allow the Deployer to create and manage the environment of each enterprise bean.

That's why 1 is correct.

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.

That's why 3 is incorrect - should use tools.

4. The Container makes the environment naming context available to the enterprise bean instances at runtime. The enterprise bean�s instances use the JNDI interfaces to obtain the values of the environment entries.

That's why 5 is correct and 4 is incorrect.

Each enterprise bean defines its own set of environment entries. All instances of an enterprise bean within the same home share the same environment entries; the environment entries are not shared with other enterprise beans. Enterprise bean instances are not allowed to modify the bean�s environment at runtime.

That's why 2 is incorrect.


SCEA | SCBCD | SCWCD | SCJP - The kSpace
Rahul Mishra
Ranch Hand

Joined: Jan 22, 2006
Posts: 211
JDiscuss..
Rahul Mishra
Ranch Hand

Joined: Jan 22, 2006
Posts: 211
Thanks guys ..that does make sense..but its like they are trying to get a bit too deep into the skin for comfort
k space
Ranch Hand

Joined: Jun 25, 2002
Posts: 104
its like they are trying to get a bit too deep into the skin for comfort


Hoping these kind of questions won't appear in the real exam.
Rahul Mishra
Ranch Hand

Joined: Jan 22, 2006
Posts: 211
yes...but at the end..all we can do is hope..for hope
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mock Exam Question(Repost)
 
Similar Threads
EJB References question/ why this answer?
Question on enterprise bean's environment
Confused about environment entries
Question from ejbcertificate.com
a mock question