Deploying the JCICS examples

You can use the example CICS® bundle in the IBM® CICS SDK for Java™ to deploy the JCICS examples to a CICS region.

Before you begin

You must create the JCICS example projects, as described in Creating the JCICS examples.

About this task

CICS loads and runs Java applications from zFS, so you must deploy your compiled applications to a suitable directory in zFS. You can create a suitable directory in zFS by using the z/OS® perspective in CICS Explorer®. CICS must have read and execute access to the directory.

The IBM CICS SDK for Java provides support for deploying Java applications in a CICS bundle project to zFS. A CICS bundle project groups a set of OSGi bundles together that are logically deployed and managed as a single unit. You can use the example CICS bundle project to deploy the JCICS examples to a CICS region.

Procedure

  1. In the Eclipse IDE, open the Java perspective.
  2. Open the New Example wizard by using one of the following choices:
    • In the Eclipse menu bar, click File > New > Example.
    • Click the down arrow on the New icon and click Example.
    • In the Project Explorer or Package Explorer view, right-click and click New > Example.
  3. In the Java folder, select CICS Bundle OSGi Example and click Next.
    Eclipse creates a name that is the folder location of the examples in the workspace, followed by the example name. For example, the default project name for the CICS bundle is com.ibm.cics.server.examples.bundle.
  4. Click Finish.
    Eclipse creates the CICS bundle project that contains a manifest and three resources. These resources reference the three OSGi bundles.
  5. Open the web.osgibundle file to check its contents.
    This file is in XML format and contains the symbolic name and version of the OSGi bundle. It also contains the name of a sample JVM server. The JVM server is the runtime environment for Java applications in CICS. When you create your own applications, you must provide the name of the target JVM server in this file.
  6. Deploy the CICS bundle to zFS:
    1. Right-click the CICS bundle project and select Export Bundle Project to z/OS UNIX File System.
    2. Select Export to a specific location in the file system and click Next.
    3. Enter your FTP credentials if required.
      If you have not previously set up a connection, you must create a connection to a target host machine.
    4. Browse to a directory where you want to deploy the CICS bundle and click Finish.
    The CICS bundle is deployed in the specified directory.
  7. Open the CICS SM perspective. In the CICSplex Explorer view, select the CICS region where you want to run the JCICS example programs.
  8. Install the JVMSERVER resource, DFHJVMS, which is in the sample group DFH$OSGI.
    The resource creates a sample JVM server in the CICS region that contains an OSGi framework. This resource name matches the name of the JVM server that was specified in the manifest of the CICS bundle. You can check the status of the JVM server by clicking Operations > Java > JVM Servers.
  9. Open the Bundle Definitions view by clicking Definitions > Bundle Definitions.
    This view lists all the bundle definitions for the CICS region.
  10. In the Resource Group Definitions view, select the supplied DFH$OSGI group.
    If this view is not open, select Window > Show view to open it in the Eclipse perspective.
    The Bundle Definitions view is filtered to display the DFH$OSGB resource definition.
  11. Copy the resource definition to a new group to edit the attributes:
    1. Right-click DFH$OSGB and select Copy.
    2. Right-click anywhere in the Resource Group Definitions view and select Paste.
    3. Enter a new group name and click OK.
  12. Edit the BUNDLE resource definition in the new group to change the bundle directory to match the location of the deployed CICS bundle.
  13. Right-click the definition to install the BUNDLE resource.
    You can check the BUNDLE installed in the ENABLED state by clicking Operations > Bundles. You can also check the list of OSGi bundles by clicking Operations > Java > OSGi Bundles.
  14. To run the examples in a JVM server, install the DFH$OSGI sample group in the CICS region.
    This group contains the resource definitions for all the samples. The sample BUNDLE and JVMSERVER resources are not installed because you have already created resources of the same name.
    When you install the group, CICS creates the resources that are required to run the examples.

Results

You successfully deployed the example CICS bundle to zFS and created the CICS resources that are required to run the JCICS examples.

What to do next

You can run the JCICS examples, as described in Running the JCICS examples.