JVM server runtime environment

A JVM server is a runtime environment that can handle many concurrent requests for different Java™ applications in a single JVM. You can use a JVM server to run threadsafe Java applications in an OSGi framework, run web applications in a Liberty profile, and process web service requests in the Axis2 web services engine.

A JVM server is represented by the JVMSERVER resource. When you enable a JVMSERVER resource, CICS® requests storage from MVS™, sets up a Language Environment® enclave, and launches the 64-bit JVM in the enclave. CICS uses a JVM profile that is specified on the JVMSERVER resource to create the JVM with the correct options. In this profile, you can specify JVM options and system properties, and add native libraries; for example, you can add native libraries to access DB2® or IBM® MQ from Java applications.

One of the advantages of using JVM servers is that you can run many requests for different applications in the same JVM. In the following diagram, three applications are calling three Java programs in a CICS region concurrently using different access methods. Each Java program runs in the same JVM server.

Diagram shows three applications, which are accessing three Java programs in a CICS region by using different methods: EXEC CICS LINK, EXEC CICS START, and an HTTP request. Each program runs in the same JVM server. The JVM server contains a Language Environment enclave and inside the enclave is a JVM.

Java applications

To run a Java application in a JVM server, it must be threadsafe and packaged as one or more OSGi bundles in a CICS bundle. The JVM server implements an OSGi framework in which you can run OSGi bundles and services. The OSGi framework registers the services and manages the dependencies and versions between the bundles. OSGi handles all the class path management in the framework, so you can add, update, and remove Java applications without stopping and restarting the JVM server.

The unit of deployment for a Java application that is packaged using OSGi is a CICS bundle. The BUNDLE resource represents the application to CICS and you can use it to manage the lifecycle of the application. The IBM CICS SDK for Java provides support for deploying OSGi bundles in a CICS bundle project to zFS.

To access the Java application from outside the OSGi framework, use a PROGRAM resource to identify the JVM server in which the application is running and the name of the OSGi service. The OSGi service points to the CICS main class.

For more information about using the OSGi framework in a JVM server, see Java applications that comply with OSGi.

Java web applications

In addition to running Java applications in an OSGi framework, the JVM server also supports running WebSphere® Application Server Liberty. Liberty is a lightweight application server for running web applications. Web applications can use JCICS to access resources and services in CICS, and to access data in DB2. Applications running in Liberty are accessed through the TCP/IP sockets layer in z/OS® rather than through web support in CICS.

The diagram shows a CICS region that contains a JVM server. The JVM server is running a Liberty profile server. The Liberty profile server receives an HTTP request through the TCP/IP sockets layer in z/OS. The Liberty profile server contains a web application that uses JCICS to access a VSAM file and a DB2 middleware bundle that uses JDBC to connect to DB2.

Java web applications can follow the Liberty model for deployment, where developers can deploy web archive (WAR) files or enterprise application archive (EAR) files directly into the drop-in directory of Liberty, or use the CICS application model of creating CICS bundles. CICS bundles provide lifecycle management and can package an application that contains many components, including OSGi bundles and WAR files, together.

To access OSGi bundles from a web application, you must deploy your application as an Enterprise Bundle Archive (EBA) file. To develop EBAs, you can use Rational® Application Developer, or you can use a combination of the Eclipse IDE, the IBM CICS SDK for Java, and WebSphere Application Server Developer Tools for Eclipse. The latter set of tools is free to use but, apart from the IBM CICS SDK for Java, IBM support is not available for them.

For more information about using Liberty, see Java applications in a Liberty JVM server.

Web services

You can use a JVM server to run the SOAP processing for web service requester and provider applications. If a pipeline uses Axis2, a SOAP engine that is based on Java, the SOAP processing occurs in a JVM server. The advantage of using a JVM server for web services is that you can offload the work to a zAAP processor.

For more information about using a JVM server for web services, see Java web services.