If I have a J2EE application with web(JSP,servlet), and EJB,do I need to build remote interface for EJB?
I think the remote interface is nessisary only when independaten application talk to EJB.
I think there is no reason to put JSP(servelet) and EJB on diffrent machine.
if the J2EE application is run on a cluster enviroment,do I need remote interface.I just think in case one EJB container down,jsp could look up ejb in another node.but this sounds funny,there is few chance the EJB contain down and web contain still alive.
is my understanding correct?
-
why do I need remote interface if only web and ejb are used (4 messages)
- Posted by: zhang zhang
- Posted on: May 14 2005 21:22 EDT
Threaded Messages (4)
- Well you are right by Mikkel Heisterberg on May 15 2005 01:34 EDT
- Well you are right by zhang zhang on May 15 2005 08:38 EDT
- Well you could by Mikkel Heisterberg on May 16 2005 02:42 EDT
- Well you are right by adrian osullivan on May 16 2005 05:18 EDT
- Well you are right by zhang zhang on May 15 2005 08:38 EDT
-
Well you are right[ Go to top ]
- Posted by: Mikkel Heisterberg
- Posted on: May 15 2005 01:34 EDT
- in response to zhang zhang
You only need remote interfaces if you need to talk to your EJB's remotely. If all of it (jsps, servlets, ejbs) runs inside the same container I would suggest you stick with local interfaces.
I you need remote access to your EJB's the most common way to do it is to keep your entity beans with local interfaces but also provide remote interfaces for your session beans. The remote clients talk to the session bean which in turn handles the entity communication.
/lekkim -
Well you are right[ Go to top ]
- Posted by: zhang zhang
- Posted on: May 15 2005 08:38 EDT
- in response to Mikkel Heisterberg
thank you.
what about in the cluster enviroment.is it posible jsp access the ejbs in another node? -
Well you could[ Go to top ]
- Posted by: Mikkel Heisterberg
- Posted on: May 16 2005 02:42 EDT
- in response to zhang zhang
Well the JSP's could access the EJB's on any specific node though it kind of defeats the point. The real point of the cluster is to have the JSPs be unaware of the server it talks to. It just knows that it can access the EJBs on a server. -
Well you are right[ Go to top ]
- Posted by: adrian osullivan
- Posted on: May 16 2005 05:18 EDT
- in response to zhang zhang
Remeber accessing Local or Remote interfaces is not a decision the container makes - the client chooses local or remote very explicity when it does the JNDI lookup of the EJB home. In your case, you want to lookup the only the local home.
That said, even if you lookup a remote home in a cluster, most containers will almost always choose to return the ejb home colocated in the same container. Hence implementing local interfaces is not as important as you may think.