• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Remote and Local Interfaces

 
Ahsan Jamil
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • 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,
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Oh Ok, thanx

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

Thanx
 
Jack Lau
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Why B is correct?

Thanks,
Jack
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • 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.
 
Ganesh Krishnan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic