Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How does an ejb communicate with it's container?  RSS feed

 
Kayla Richard
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me what is the link between these? thks.
 
Rich Raposa
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bean provides the "business logic", and the container provides everything else. A bean is often thought of as "residing" in a container (thus the term container).
A container is actually a class (or collection of classes and interfaces) written by the application server that is unique to the various settings of your bean. When a client invokes a method on a bean, the container "intercepts" the method call and performs various tasks before invoking the actual method on the bean. The container may need to start a transaction, or authenticate the caller, or synchronize data in the bean with the database, and so on.
Since the container does all this work for you, as a bean developer you can focus on solving the task at hand. It's a beautiful thing!
 
Thomas Taeger
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kayla Richard:
Can anyone tell me what is the link between these?

Hi Kayla,
please tell us _what_ an EJB communicates with its container so we can collectively think about the "how", ok?
(Otherwise we would probabely talk only about how the container manages the EJB and not the other way around).
Thomas.
 
Kayla Richard
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Rich.
Thks for the reply, my question would be in regards to your line:
"performs various tasks before invoking the actual method on the bean. "
What are the various tasks? This is what I am confused about. Thks.
 
Kayla Richard
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Thomas,
Basically the question is how they communicate with each other. I believe part of it has to do with deployment descriptors? (The settings in there).?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the EJB Spec. Or, read a book on EJB's -- they ALL cover this. Basically, there is an object called the "EJBObject" that is invoked first in line after the RMI-IIOP call arrives at the server end that handles setting up the transaction and security contexts. Of course, the definition of WHAT it is suspposed to do with these is taken from the deployment descriptor. The EJBObject is then responsible for calling the bean implementation class.
Kyle
[ January 31, 2003: Message edited by: Kyle Brown ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!