Stage 1. Using ATK to edit the deployment descriptor

  1. Copy the SampleEJB.jar file from the HFS samples directory to your workstation. You can do this using FTP in binary mode, or any other method of your choice. The HFS samples directory is /usr/lpp/cicsts/<cics_name>/samples/ejb/bankaccount. For ATK, you also need to perform the same process for the dfjcci.jar file, which is in the /usr/lpp/cicsts/<cics_name>/lib directory. You do not need to edit that JAR file, but ATK needs it to rebuild the JAR file for the EJB bank account sample correctly after editing.
  2. Import the JAR file into ATK as an EJB project.
    1. Start ATK, and go to the J2EE perspective by selecting Window > Open Perspective > J2EE.
    2. Select the Import option from the File menu. Select EJB JAR file as the import source. Select Browse and find the SampleEJB.jar file. Enter a suitable name for the project. Select Next and choose to import all enterprise beans, which is the default. Select Finish to create the EJB project.
    3. When the project is created, you should see some errors appear in the Tasks list. To correct these errors, you need to add the dfjcci.jar file to the build path for the EJB project. In the left-hand navigation pane (using the J2EE hierarchy view), expand the EJB Modules item to see your EJB project. Right-click on the project name and select Properties. Select Java Build Path. Go to the Libraries tab and select the Add External JARs button. Navigate to the dfjcci.jar file and select Open. Select OK. ATK rebuilds the EJB project and the errors should disappear.

    At this point, in order to familiarise yourself with ATK, you can browse through the contents of the JAR file. For more information about the EJB deployment descriptor, see Enterprise beans—the deployment descriptor.

  3. Add security roles to the deployment descriptor. In ATK, in the left-hand navigation pane (using the J2EE hierarchy view), expand the EJB Modules item to see your EJB project. Double-click on the project name to open the project. Select the Assembly Descriptor tab at the bottom of the pane. Under Security Roles, select the Add button to add a new security role.
    If your organisation has already set up security roles for use with other applications, you may want to reuse an existing role. If so, supply the name of the role that you want to use in the field provided. If you don't have an existing security role that you want to reuse, enter a new role name, such as “All_users”. You can also provide an optional description of the role to act as a memory aid in the future. Select Finish to return to the main window.
    Note: If you reuse an existing security role which is already defined to your ESM, you must remove the Display Name element from the JAR file's deployment descriptor. This element is used by CICS to provide an application name which is prefixed to all security role names when performing a security check at runtime, thus providing support for security roles scoped at the application level rather than enterprise-wide. In ATK, you can remove this element by selecting the Overview tab at the bottom of the pane. Select the text in the Display Name field and delete it.
  4. Now define a method permission and associate it with a security role. In ATK, select the Assembly Descriptor tab again. Under Method Permissions, select the Add button. The wizard presents a list of the security roles that you have defined. For the Bank Account sample, it's appropriate to run all the methods under the same security role. Select the security role that you want to associate with the method permission, and select Next. Select the CICSSample bean, and select Next. Check the box for CICSSample to select all the method elements for the bean. Select Finish. You are returned to the previous screen.
  5. Save the updated deployment descriptor by selecting the Save option from the File menu.
  6. Export the project from ATK back into a JAR file on your workstation. To do this, select the Export option from the File menu. Select EJB JAR file as the export destination, and select Next. Select your EJB project from the drop-down list. Select Browse and locate the SampleEJB.jar file to be used as the destination. (This overwrites your original version of the file. You might want to keep a backup of the original version of the file on your workstation under a different name.) Select the checkbox for Export source files to keep the source files with the JAR file. Select Finish. Exit ATK.
  7. Copy the updated SampleEJB.jar file back to HFS. You can use either FTP in binary mode or your preferred file transfer process. Save the SampleEJB.jar file to the pickup directory of your CorbaServer.