This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I want my EJB to behave as remote and local as well. If my EJB is being called from client ( say servlet ) then there sbould be a remote call. If my EJB is being called from any other EJB then it should be a local call.
Using local interfaces we can do. But my EJB should be remote and local as well.
for this i have an aproach. I dont know how far it is correct and reliable.
the aproach is as follows :
I will declare my EJB in the ejb-jar.xml for remote block and also for local block. but with different ejb names. I use remote ejb name to lookup from the servlet. and i use local ejb name to lookup from another EJB. Will this be a good approach. Or there are any other alternatives to acheive this type of issue.
Thanks with Regards Venkat
Shrinivas Mujumdar
Ranch Hand
Joined: Aug 27, 2004
Posts: 328
posted
0
Hello, What you are saying is correct, Your EJB will have 4 interfaces 2 Component interfaces & 2 local interfaces. As well as you have to write entries in ejb-jar.xml
I will declare my EJB in the ejb-jar.xml for remote block and also for local block. but with different ejb names. I use remote ejb name to lookup from the servlet. and i use local ejb name to lookup from another EJB. Will this be a good approach. Or there are any other alternatives to acheive this type of issue.
If you have defined local interfaces for an EJB and is called from another EJB in the same container then you will always get the local instance. You don't need to name local and remote differently.