How to access EJBs

The basic steps for accessing EJBs from any type of client are:

  • Retrieve the home interface
  • Find or create an EJB instance
  • Invoke the methods of the EJB instance

Home interface

There are basically two ways to retrieve a home interface:

  • Access with fully qualified bean home name— You access a bean using its JNDI name. This is only possible for a remote home interface and should only be used for thin clients where no J2EE container is available. The JNDI name is stored in an extension of the deployment descriptor (ibm-ejb-jar-bnd.xmi).

  • Access with an EJB reference— You access a bean using an EJB reference that is defined in the deployment descriptor and that points to the EJB. The container is responsible for translating this ...

Get EJB 2.0 Development with WebSphere Studio Application Developer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.