Portlet Factory, Version 6.1.2


 

Linking to an EJB

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:

  1. Open a new EJB Call builder and give it a name.

  2. 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.

  3. 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.

  4. Check the Cache Home Interface checkbox if you want to cache home interfaces. This will provide significantly better performance.

  5. Fill in the JNDI information if the EJB is not located on the same application server as WebSphere Portlet Factory.

  6. 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:

    1. Select a create() method for the bean. The dropdown list should be populated based on the create() methods available in the EJB.
    2. 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.
    3. 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.

    4. 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.

  7. Click Apply or OK.

Parent topic: EJB Call builder


Library | Support |