This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Meaning of Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Meaning of "EJB Container" in conjunction with "ENC"?" Watch "Meaning of "EJB Container" in conjunction with "ENC"?" New topic
Author

Meaning of "EJB Container" in conjunction with "ENC"?

Dirk Dühr
Greenhorn

Joined: Feb 08, 2009
Posts: 11
Hello mooses,

I regularly wonder about the correct meaning of the phrase "EJB Container" in conjunction with "ENC".
Does it mean "Application Server" or does it mean "deployed EJB-Jar" in this context?
Or even something completely different?

A quote from O'Reillys "EJB 3.0", intro of chapter 14:
"Every EJB container that is deployed in an application server has it's own personal internal registry called Enterprise Naming Context (ENC) ..."

Do I have as much ENCs in my application server as EJB-Jars deployed?
And is this idea correct: The ENC contains private local contexts for each Enterprise Bean/Interceptor?

Any idea?

Thanks a lot.
Raf Szczypiorski
Ranch Hand

Joined: Aug 21, 2008
Posts: 383
I will try to answer in my words. For me, a container is runtime environment that provides different services, in this case its security, transactions, and the like. Like Java, itself, but better. You write classes (EJB) that adhere to the contract specified in the specs, and the container (the runtime) also adheres to it so that you know what you can expect and what you can't. The container instantiates your classes, and manages their lifecycles, kind of like when Java manages your main class' lifecycle.
For ENC, every bean has its private environment, where you can add various settings (env-entries) and bind necessary objects (ques, topics, other beans...) that the bean may use. It is implemented in a form of a javax.naming.Context in Java EE.
As for the sentence you quoted, I don't fully understand it, looks like there is a mistake - the "container" word doesn't fit in.

Raf
Dirk Dühr
Greenhorn

Joined: Feb 08, 2009
Posts: 11
Thanks, Raf.

Good point to examine a Java EE application from the perspective of contracting parties.
And glad to see the quote from "EJB 3.0" seems to be misleading or even a mistake actually.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Meaning of "EJB Container" in conjunction with "ENC"?