Accessing Session Beans

After we implemented the session beans, we should be able to access it.

EJB interactions:

A client for and EJB can be:

  1. Java EE Application Client
  2. Java EE component (JSP,Servlet,JSF,EJB)
  3. Any java object
  4. Java application

Client finds a proxy to interact with an EJB using:

  1. Java naming and directory interfaces(JDNI)
  2. Dependency Injection(used most of the time)

Steps for interacting with with and EJB(3-step plan)

  1. Declare the reference for the EJB interface
  2. Get the EJB “instance”
    1. using JNDI for remote clients or legacy EJBs
    2. using DI for local clients or application clients
  3. Invoke methods on the interface

 

Leave a Reply

Your email address will not be published. Required fields are marked *