Generating Command Beans

Using the Command Bean Creation wizard, you can create a command bean to invoke certain EIS operations.

Creating a command bean allows you to encapsulate the execution of a specific operation within the EIS. Input and output parameters are established through get and set methods, and the operation is executed when the execute() method of the bean is called.
Command beans are created after the J2C bean's implementation is generated, and it uses the method-level annotation tag @j2c.command to specify the command bean class that will be generated for a given method.



To create a command bean, follow these steps:

  1. To start the Command Bean Creation wizard from the menu bar, select File > New > Other > J2C.
  2. Select Command Bean Creation.
  3. Click Next.
  4. On the J2C Java™ bean selection page, the J2C bean implementation field may be populated with the J2C Java bean implementation that you want to use (for example, /CustomerProj/JavaSource/sample/cics/CustomerImpl.java). If the J2C bean implementation field is empty, or if you want to select a different implementation, click Browse.
    1. In the Find J2C Bean page, in the Select entries field, type the name of the J2C bean implementation you want to use.
    2. In the Matching entries field, select the name of the J2C bean you want to use.
    3. Click OK.
  5. Click Next.
  6. In the Command Bean Creation page, in the Select methods which functionality you want to expose as Command Beans, select the method(s) that you want to expose.
    1. By default, the class name of the command bean will be the name of the selected method, with the initial letter capitalized. For example, getCustomer() method becomes the class GetCustomer. If you want to change the class name, highlight the name and type in an alternative.
  7. To change the names of input or output parameters, select the input name and type in an alternative name. Similarly for output name, select it and type in a new name.
  8. Click Finish. The required tags are added to the J2C bean implementation and the corresponding command beans are generated
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.