• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

local interface ?

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess anewers are 1, 2, and 3.

Thanks,
Ugender
 
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think all are correct b/c modules from other EAR files can also be called...
 
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question is from Java Black Belt.com exam for EJB basic .........
Answer is 1,2,3
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic