Preparing an OSGi application to be called by a CICS
program using CICS-MainClass
You can enable a Java
main method to be called by a CICS® program
by using OSGi configuration. The OSGi application runs in an OSGi JVM server and can be deployed
within an OSGi bundle JAR.
Before you begin
main method you want to call.
Procedure
Results
Example
CICS-MainClass header for the
classes com.example.App and
com.example.TargetManifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Example CICS-MainClass Bundle
Bundle-SymbolicName: com.example
Bundle-Version 1.0.0
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.ibm.cics.server;version="[1.900.0,3.0.0)"
CICS-MainClass: com.example.App,
com.example.TargetWhat to do next
Create a PROGRAM definition for each target class, with a JVMCLASS attribute set
to the fully qualified name of the target class, as defined in the CICS-MainClass
header of the MANIFEST.MF file. PROGRAM definitions can be defined in the CSD file, or in a CICS bundle. The PROGRAM definition can be located in the same CICS bundle as the OSGi bundle part.
For example, a program that is named OSGIAPP targeting the class
com.example.App deployed on the JVM server OSGIJVM would
be defined:
PROGRAM(OSGIAPP) JVM(YES) JVMSERVER(OSGIJVM) JVMCLASS(com.example.App)
API(OPENAPI) CONCURRENCY(REQUIRED) EXECKEY(CICS)For more information, see PROGRAM resources.