Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

can client able to call EJB directly  RSS feed

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can client able to call EJB directly ?
1)if yes then how
2)if not why?
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Samanthi perera wrote:can client able to call EJB directly ?
1)if yes then how
2)if not why?


What does "directly" mean? The usual process is to lookup the EJB using JNDI.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)what are the ways of accessing EJB ?
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JNDI lookup is one way. Injection the other. I would recommend that you read this
 
Schandha Ravi
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Nobody calls enterprise beans directly, except containers. We have the interfaces to access the EJBs and we use Remote and Local interfaces for this. Below is the sequence of events.

1) Getting reference to home interface, typically using JNDI.
2) Call create method on home interface, that would result you the remote interface of the EJB.
3) Now you have the required interface and you can invoke the business methods on that interface.

This is what I know, from the earlier versions of EJB specs. But not sure if this holds good for EJB 3.0 and later. You may want to check the specs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!