Home

 

Deploying the J2C bean as an EJB 3.0 session bean

From the J2C bean, we generate a session EJB.

Select File Æ New Æ Other Æ Web page, Web Service or EJB from J2C Java bean, and click Next.

Click Browse, locate the CustomerImpl class, and click Next (Figure | 0-9).

\Taderc99\src\sample\cics\CustomerImpl.java

Figure 20-9 Generate an EJB from a J2C bean (1)

In the Deployment Information dialog, select EJB (Figure | 0-10). The target project containing the J2C bean will be transformed into an EJB 3.0 project, and the J2C bean class will be annotated as a session bean. Click Next.

Figure 20-10 Generate an EJB from a J2C bean (2)

In the EJB Creation dialog (Figure | 0-11), type j2c/taderc99 as JNDI name, and accept the other values. Click Finish.

Figure 20-11 Generate an EJB from a J2C bean (3)

Open the CustomerImpl class and verify that the annotation was added:

@Stateless(mappedName="j2c/taderc99")

public class CustomerImpl implements sample.cics.Customer {

Optimally, open the Customer class and add the @Local annotation (this is the default):

@Local

public interface Customer {

ibm.com/redbooks