• 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 versus remote interfaces

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

The EJB2.0 specification says (pages 63-64) that local interfaces must not be passed as an argument or result of a method on a bean's remote home or component interfaces. This makes sense since a plain old Java reference has no meaning outside the JVM it was created and you need a stub in this case. So I understand that remote interface methods can only deal with remote bean's references.

But notice that the specification doesn't say anything about passing or returning remote interface references from a method on a bean's local home or component interfaces. On the other hand, HF-EJB on page 161 says: "Ok, there is one exception - remember, according to Bean law you must not return a bean's Remote interface from a local interface method". Why not? Why doesn't the spec mention this? It seems to me that a local client using a remote reference should work.

Thanks in advance,
Stefan
 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

HF-EJB on page 161 says: "Ok, there is one exception - remember, according to Bean law you must not return a bean's Remote interface from a local interface method". Why not? Why doesn't the spec mention this? It seems to me that a local client using a remote reference should work



Good catch. It does sound right to me too! Why can't a bean, local to the container, lookup a remote bean and return its remote component interface to its clients?

Can someone pls help us map this 'Bean law' to the spec.
 
Stefan Guilhen
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Keerthi, thanks for your reply.

I re-read the specification and I still didnt find a law saying that "you can NEVER mix interfaces". The specification only cares about the fact that you cannot pass local references to methods on remote interfaces, but it doesn't mention the case we found in HF-EJB (passing remote references to methods on local interfaces).

Thanks again,
Stefan (still stuck trying to figure this out)
 
Keerthi P
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didn't really get a chance to validate this by writing a sample code (Will try to do it over this week-end). But it surely should work. Still wondering why Kathy/Bert does not prefer to 'return a bean's Remote interface from a local interface method'.

Lets wait for their response
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic