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

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s