This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

local interface ?

 
Ashley Bideau
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An EJB may be called through its local interface from:

1) the same ejb module
2) other ejb modules in the same EAR
3) a web module in the same EAR
4) other ejb modules in a different EAR
5) a web module in a different EAR
 
Ugender Rekulampally
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess anewers are 1, 2, and 3.

Thanks,
Ugender
 
Raj Kumar Bindal
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think all are correct b/c modules from other EAR files can also be called...
 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The question seems to be slightly confusing to me. As per my understanding any component can make local call to an ejb as long as it is in the same jvm.
Here question does not specifies whether the different ears are on the same server (same jvm) or on different server.

Do we really get these kind of questions in exams?
 
cheenu Dev
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey this question is from which mock?
First of all ashley what you need i dont understand.
by your post topic what it means? you want an answer.

better see this and please review your post here with the details about this question.
http://faq.javaranch.com/view?HowToAskQuestionsOnJavaRanch
 
Joy Mookerji
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question is from Java Black Belt.com exam for EJB basic .........
Answer is 1,2,3
 
Shraddha Pandya
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Joy Mookerji:
This question is from Java Black Belt.com exam for EJB basic .........
Answer is 1,2,3


What if instead of local it would have been remote .. as per my understanding answer should remain same..Please tell me.
 
AmitKumar Jain
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also agree with Prakash... local or remote depends on whether or not EARs are deployed in same JVM or different JVM.

However, the given answer can be true only if each EAR gets a different instance of JVM... I don't know whether this happens... I'm just guessing...
 
Shraddha Pandya
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by AmitKumar Jain:
I also agree with Prakash... local or remote depends on whether or not EARs are deployed in same JVM or different JVM.

However, the given answer can be true only if each EAR gets a different instance of JVM... I don't know whether this happens... I'm just guessing...


sorry I am not getting your answer
Remote certainly means different JVM.. What could be the most probable answer then ?
 
Joy Mookerji
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) the same ejb module
2) other ejb modules in the same EAR
3) a web module in the same EAR
4) other ejb modules in a different EAR
5) a web module in a different EAR

In case of remote 1,2,3,4,5 is true

Remote or local depends on how the interface both Home and Component Interface is defined
In case of Remote the Container generates the code for RMI-IIOP related code while implementing the Home and Component Interface (EJBHome and EJBObject extends Remote)

So whether it runs on the same JVM or not it doesnt matter if the interface is declared remote within the same EAR it will follow the same principle as if calling some remote interface.

Some container however optimizes the call when they finds out the call is actually a local call "One Client calling a EJB within the same EAR"
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic