• 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

Remote and Local Interfaces

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have read in HF EJB that

" According to Bean Law, you must not return a bean's Remote interface from a local interface method"

And there is a question in Coffee Cram.

Head First EJB , Chapter 3 Page 168

3) Given a remote client 'R', that has valid references to session beans 'A' and 'B', and given that A is a local client to B,which stattements are true? (Choose all that apply)

A) R can not pass his reference for A to B
B) A can not pass his reference for B to R
C) A can not invoke methods on B
D) B can not invode methods on R.

Answers are B and D.

Ok Im sure about B, but cannt get my head around D, why is that?Maybe im missing something but,

R also got reference of B so why not B can invoke methods ?

Thanks,
 
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
R is the client and that is why B cannot invoke methods on the client. The question is not very clear but it depends how you interpret it. The client can be anything.. no java .. right ... that means B can't invoke the methods.


Hope it helps.
 
Ahsan Jamil
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh Ok, thanx

That means , rule of thumb is that Bean cant access any of its client,isinit?

Thanx
 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Why B is correct?

Thanks,
Jack
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

That means , rule of thumb is that Bean cant access any of its client,isinit?



Depends upo the question. If it is written that the client is a java client that the question will be more confusing. But in the above case its not written that client is a java client.

Why B is correct?



Because R is remote and B has local interfaces.

hope it helps.
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
B is correct because A being local client cannot get its reference passed to a remote client....


- Ganesh.
SCJP,SCBCD,SCEA,BEA Certified Weblogic Administrator.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic