You can use the example CICS bundle in the CICS Explorer™ SDK to
deploy the JCICS examples to a CICS region.
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 using the z/OS perspective
in
CICS Explorer.
CICS must have read and execute access to the directory.
The CICS Explorer SDK 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
- In the Eclipse IDE, open the Java perspective.
- Open the New Example wizard using one of the following
choices:
- In the Eclipse menu bar, click .
- Click the down arrow on the New Wizard icon
and click Example.
- In the Project Explorer view, right-click and click .
- In the CICS Java folder, select CICS
Application Bundle Example and click Next.
- In the Project name field enter
a name for the new project. By default, 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.
- Click Finish. Eclipse
creates the CICS bundle project that contains a manifest and three
resources. These resources reference the three OSGi bundles.
- 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.
- Deploy the CICS bundle to zFS:
- Right-click the CICS bundle project and select Export
to z/OS UNIX File System.
- Enter your FTP credentials if required. You
might need to create a connection to a target host machine if you
have not previously set up a connection.
- Browse to a directory where you want to deploy the CICS
bundle and click Finish.
The CICS bundle is deployed in the specified directory.
- Open the CICS SM perspective. In the CICSplex Explorer
view, select the CICS region where you want to run the JCICS example
programs.
- Install the JVMSERVER resource, DFH$JVMS, 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 .
- Open the Bundle Definitions view by clicking . This view lists all the bundle definitions
for the CICS region.
- In the Resource Group Definitions view, select the supplied
DFH$OSGI group. If this view is not open, select to open it in the Eclipse perspective. The
Bundle Definitions view is filtered to display the DFH$OSGB resource
definition.
- Copy the resource definition to a new group to edit the
attributes:
- Right-click on DFH$OSGB and select Copy.
- Right-click anywhere in the Resource Group Definitions
view and select Paste.
- Enter a new group name and click OK.
- Edit the BUNDLE resource definition in the new group to
change the bundle directory to match the location of the deployed
CICS bundle.
- Right-click the definition to install the BUNDLE resource. You can check the BUNDLE installed in the ENABLED state by clicking . You can also check the list of OSGi bundles by clicking .
- 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 have 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.