Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Which interface is used Remote or Local?

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If i define both Local and Remote interfaces for a EJB which one is used when i try to invoke it through
a) Java client
b) Another EJB in same server
What are rules for this

Sunil
 
Ranch Hand
Posts: 390
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the spec allow one to define both local and remote interfaces for a particular bean?
Remember the definition of the interfaces depends on what you feed to the entity tag on your ejb-jar.xml. Is it allowed to feed the tag with both remote and local interfaces?
 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is. You can use define the remote and local interfaces for an EJB (Except for a MDB).
Which interface you would use depends on your client. If your client is a remote client (distributed away from the container) e.g some web tier component deployed on a web server that is not co-located with the application server, you would use the remote interface and RMI /IIOP for invocation. But if your client is a local client e.g Session Facade accessing an EntityBean, you would use the local interface . Or the container may make some optimizations that end up with the local interface being used.
You can expose both the remote and the local client view, it depoends on the type of the client which view will be used.
Hope this helps.
Akasmat.
 
A feeble attempt to tell you about our stuff that makes us money
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic