Linking to an EJBAdded by IBM on June 28, 2011 | Version 1 (Original)
|You can use the EJB Call builder to link an EJB into a model.
You can use the EJB Call builder to link an EJB into a model.
You generally follow these steps to link an EJB into a model:
- Open a new EJB Call builder and give it a name.
- Select the desired EJB from the EJB drop-down list.
This list should be populated by the EJBs available in the jars which were put into project root/WEB-INF/work/classes.
Note: The list will not include EJBs which have only a local home interface, since it would not be appropriate to try to call local interfaces in EJBs outside of the IBM® WebSphere® Portlet Factory .ear file.
- Open the EJB Info input group, and check the information.
In most cases, the appropriate values will be filled in for you. In some cases, if the EJB builder does not recognize the deployment specific descriptor, or if the deployment specific descriptor is not available, you might need to fill in the EJB JNDI name with the appropriate value.
- Check the Cache Home Interface checkbox if you want to cache home interfaces.
This will provide significantly better performance.
- Fill in the JNDI information if the EJB is not located on the same application server as WebSphere Portlet Factory.
- Open the Constructor input group. In the simplest case, if the EJB being called is a Session bean with a no-arg create() method, leave all of the inputs blank; otherwise:
- Select a create() method for the bean.
The dropdown list should be populated based on the create() methods available in the EJB.
- For each of the arguments to the create() method, select the appropriate value in the argument table.
The inputs can be either literal values, or indirect values.
- If the EJB is an entity bean, you will also select a Finder method, and Finder method arguments.
Note: The dropdown list is only populated by the Finder methods which return a single bean, and not ones which return a collection of beans.
- Click Generate.
This will generate a constructor for the Remote Interface. This constructor should work in most cases. You can make changes by hand if you want a different constructor.
- Click Apply or OK.
Parent topic: EJB Call builder