Developing applications using the CICS Explorer SDK

CICS Explorer® includes the CICS® SDK for Java™ and optionally the CICS SDK for web and JSP. This CICS Explorer SDK provides an environment for developing and deploying Java applications to CICS, including support for OSGi and web projects. If you want to develop Java applications without using the SDK, see Developing applications using other tools.

About this task

You can use the CICS Explorer SDK to create new applications, or repackage existing Java applications to comply with the OSGi specification. The OSGi Service Platform provides a mechanism for developing applications using a component model and deploying those applications to a framework as OSGi bundles. An OSGi bundle is the unit of deployment for an application and contains version control information, dependencies, and application code. The main benefit of OSGi is that you can create applications from reusable components that are accessed only through well-defined interfaces called Java packages. You can then use OSGi services to access the Java packages. You can also manage the lifecycle and dependencies of Java applications in a granular way. For information about developing applications with OSGi, see the OSGi Alliance website.

You can also use the CICS Explorer SDK to work with dynamic web projects and OSGi application projects that include Java servlets and JSP pages. You can create an application that has a modern web layer and business logic that uses JCICS to access CICS services. If your web application needs to access code from another OSGi bundle, it must be deployed as an OSGi Application Project (EBA file). You must either include the other OSGi bundle in the application manifest, or install the other bundle in the Liberty bundle_repository as a common library. The EBA file must include a web-enabled OSGi bundle (WAB file) to provide the entry point to the application and to expose it as a URL to a web browser.

You can use the CICS Explorer SDK to develop a Java application to run in any supported release of CICS. Different releases of CICS support different versions of Java, and the JCICS API has also been extended in later releases to support more features of CICS. To avoid using the wrong classes, the CICS Explorer SDK provides a feature to set up a target platform. You can define which release of CICS you are developing for, and the CICS Explorer SDK automatically hides the Java classes that you cannot use.

The CICS Explorer and CICS Explorer SDK help provides full details on how you can perform each of the following steps to develop and deploy applications.

Procedure

  1. Set up a target platform for your Java development.
    For detailed instructions, see the relevant step in Creating the JCICS examples or Creating the servlet examples.

    The target platform ensures that you use only the Java classes that are appropriate for the target release of CICS in your application development.

  2. Create an OSGi bundle project or a plug-in project for your Java application development.
    1. The default version of the project is 1.0.0.qualifier. In the Version field either remove the ".qualifier" from the end of the version number, if you do not wish to use one, or set it to something meaningful, for example the date/time stamp.
    Develop your Java application using best practices; for example, to organize the dependencies between OSGi bundles, use Import-Package/Export-Package in preference to Require-Bundle.
  3. If you are new to developing Java applications for CICS, you can use the examples that are provided with the CICS Explorer SDK to get started.
    To use JCICS in a Java application, you must import the com.ibm.cics.server package.
  4. Optional: Create a dynamic web application (WAR) or a Web-enabled OSGi bundle project (WAB) to develop your application presentation layer.
    You can create servlets and JSP pages in a dynamic web project. For a WAR file, you must also modify the target platform to give you access to the Liberty API bundles. For further details refer to Setting up the development environment.
  5. Package your application for deployment:
    1. If you are deploying a Web-enabled OSGi bundle project (WAB), create an OSGi application project (EBA)
    2. Create one or more CICS bundle projects to reference your EBA, yourEAR file or your web application (WAR file).
      CICS bundles are the unit of deployment for your application in CICS. Put the web applications that you want to update and manage together in a CICS bundle project. You must know the name of the JVMSERVER resource in which you want to deploy the application.

      You can also add a subset of CICS resources to the CICS Bundle project, such as PROGRAM, URIMAP, and TRANSACTION resources. These resources are dynamically installed and managed as part of the application.

    3. Optional: If you want to deploy the application to a CICS platform, create an application project that references your CICS bundles.
      An application provides a single management point for deploying and managing the application across a CICSplex in CICS. For more information, see Packaging applications for deployment.
    4. You should always explicitly declare the packages that your OSGi bundle uses, even if the tooling does not indicate an error. You can do this by adding or updating the Import-Package bundle header in your OSGi bundle manifest. Tools such as Eclipse make assumptions about the availability of javax.* packages that might not be correct for a runtime environment where an explicit Import is necessary.
  6. Deploy your Java application to zFS by exporting the application project or CICS bundle projects. Alternatively, you can save the projects in a source repository for deployment.

Results

You have successfully developed and exported your application by using the CICS Explorer SDK.

What to do next

Install the application in a JVM server. If you do not have authority to create resources in CICS, the system programmer or administrator can create the application for you. You must tell the system programmer or administrator where the exported bundle is located and the name of the target JVM server. For details, see Deploying OSGi bundles in a JVM server. You might also need to update the Target Platform to add third party OSGi bundles such as IBM® MQ to your Eclipse development environment. See Updating the Target Platform.