Initial request

When accessing an EJB there are two groupings of clients, cluster aware and cluster unaware. Cluster aware clients are those that are running within an IBM ORB and therefore have access to the WLM information about WAS clusters.

These steps describe what happens when using a cluster aware client to access an EJB:

  1. First, the client has to retrieve the initial context.

  2. Next, the client needs to look up the EJB home based on the JNDI name, for example:

    Object home = initContext.lookup("java:comp/env/BeenThere");
    BeenThereHome beentherehome =
    (BeenThereHome) narrow(home, BeenThereHome.class);

    This example uses an EJB reference, java:comp/env/BeenThere. As discussed in Perform lookup in an EJB or Web container in the same cell, this EJB reference must be bound to the fully qualified JNDI name of the deployed EJB, for example:

    cell/clusters/EJBcluster/BeenThere.
    

    Using EJB references would not be possible in a stand alone EJB client as it is not running in a container.

  3. The client needs to create or retrieve an EJB object, using the create method or finders of the home interface, for example:

    BeenThere beenThere = beentherehome.create();

  4. Once the EJB object has been created, you can invoke methods from the remote interface, for example:

    Hashtable envInfo = beenThere.getRuntimeEnvInfo();

We will call these four steps the initial request from the EJB client. Let us see in detail what is happening from a workload management point of view, using Figure 6-5:

  1. The new InitialContext request goes through the ORB (Object Request Broker). This returns a JNDI context object.

  2. The lookup on the context returns a home object of the BeenThere bean. This is an indirect IOR (Interoperable Object Reference), that is, it points to the Location Service Daemon (LSD) on the local Node Agent.

  3. The first request goes to the LSD and the LSD selects one of the cluster members by using the WLM plug-in in the LSD.

  4. The LSD returns a direct IOR to the specific cluster member.

  5. The request is forwarded to the cluster member that the LSD selected.

  6. Upon successful completion of the request, the response contains the cluster configuration information. WLM plug-in stores the cluster configuration information and uses it for subsequent requests.

Figure 6-5 EJB workload management

  Prev | Home | Next

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.