Skip to Main Content U.S. Department of Energy

Accessing EJBs in MIF

There are two ways to access EJBs from a MIF module.

  1. EJB Module: An EJB module is created. In this case, the EJB itself is the implementation code (see EJB Modules).
  2. Wrapper Client: The EJB method is called Directly from the implementation class, as a typical EJB client.

1. EJB Module

The programmer creates a special kind of module called a MifEjbModule. A MifEjbModule is just like a regular module except that the implementation of the module is specified by supplying the name of the EJB bound in JNDI. MIF adds the EJB module to the pipeline by doing a JNDI lookup on the bean and transparently links the EjbModule to the actual EJB. The EjbModule exchanges data with other modules via JMS endpoints. So, the programmer must also add an EjbJmsConnector to the pipeline. This connector makes an EJB available via JMS endpoints.

This type of EJB interaction provides the cleanest integration with MIF, since the EJB becomes part of a pipeline in the same way as a typical implementation class would. An example can be found in: EJB Modules.

Diagram of EJB module

2. Wrapper Client

The programmer creates a regular MifModule and provides a Java implementation class. In the body of the implementation's listen() method, a regular EJB client is created just as it would be if MIF were not being used. The programmer can choose to use any kind of endpoints for communication with other modules.

For programmers who are experienced with EJB, this is the easiest way to access an EJB within a MIF application.

Diagram of EJB wrapper

accessing_ejbs.txt · Last modified: 2008/03/06 09:36 by adamw