File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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

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

Dirk Dühr

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.

Dirk Dühr

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.
subject: Meaning of "EJB Container" in conjunction with "ENC"?
It's not a secret anymore!