CICS® provides a channel-based interface to call a
Java™ program that is running in a JVM server. This interface
is provided for vendor implementations that use JVM servers for non-OSGi Java programs. It is not for use with OSGi Java programs.
About this task
The channel-based interfaces are provided as a mechanism for vendors to create and access Java programs that are running in a JVM server. The interface is
provided for compatibility only and must not be used for user Java applications. The JVM server is primarily provided as an OSGi framework for Java applications, providing granular life cycle management of
applications.
Procedure
- Edit the JVM profile for the JVM server.
The default profile is
DFHOSGI.jvmprofile, but this is specifically set up for an OSGi framework. Add
in the following options to run non-OSGi Java
workloads:
- Use the class path options to specify the class path of the Java programs.
-
Use the SETUP_CLASSES option to add classes that run during the initialization
of the JVM to set up the environment for all applications. For example, you might add a class that
sets the state for a number of global static variables or a class that acquires a connection to Db2®. Setup classes cannot contain
JCICS methods.
- Use the TERMINATION_CLASSES option to add classes that run during the
shutdown of the JVM. For example, you might add a class that resolves any outstanding states that
are left by the applications or that perform some additional logging. Termination classes cannot
contain JCICS methods.
- Use the THREAD_TIMEOUT to specify how many seconds CICS waits for the setup and termination classes to finish running during the
initialization or shutdown of the JVM server.
- Save the JVM profile in the directory specified by the JVMPROFILEDIR system
initialization parameter.
- Create a JVMSERVER resource that specifies the JVM profile.
- Create a program that creates a channel called DFHSJJS-V1
and populates a set of control containers.
The mandatory
containers are DFHSJ-JVMSERVER (which identifies the target JVMSERVER
resource), and DFHSJ-USERCLASS (which identifies the target Java class).
- Use a LINK command to link from the program to the CICS-supplied program DFHSJJI. The DFHSJJI program reads the control containers and attaches to the requested JVM server.