CICS TS for Z/OS: Java Applications in CICS Chapter 1
Total Page:16
File Type:pdf, Size:1020Kb
CICS Transaction Server for z/OS 5.6 Java Applications in CICS IBM Note Before using this information and the product it supports, read the information in Product Legal Notices. This edition applies to the IBM® CICS® Transaction Server for z/OS®, Version 5 Release 6 (product number 5655- Y305655-BTA ) and to all subsequent releases and modifications until otherwise indicated in new editions. © Copyright International Business Machines Corporation 1974, 2020. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents About this PDF.....................................................................................................vii Chapter 1. CICS and Java...................................................................................... 1 The OSGi Service Platform...........................................................................................................................2 JVM server runtime environment................................................................................................................ 4 JVM profiles..................................................................................................................................................5 Structure of a JVM........................................................................................................................................7 Classes and class paths in JVMs............................................................................................................7 Storage heap in JVMs............................................................................................................................. 8 Where JVMs are constructed................................................................................................................. 8 CICS task and thread management.............................................................................................................8 Shared class cache.................................................................................................................................... 10 Which JVM server to use: Liberty JVM or OSGi JVM?............................................................................... 11 Java applications that comply with OSGi..................................................................................................12 Java applications in a Liberty JVM server................................................................................................. 16 Java web services...................................................................................................................................... 17 Spring Boot support in CICS......................................................................................................................20 Chapter 2. Developing Java applications .............................................................23 Java runtime environment in CICS ...........................................................................................................23 Setting up your development environment...............................................................................................24 Developing applications using the IBM CICS SDK for Java ..................................................................... 25 Setting up the Target Platform............................................................................................................. 26 Creating a plug-in project.....................................................................................................................27 Updating the plug-in project manifest file...........................................................................................28 Creating a Java EE application.............................................................................................................29 Adding a project to a CICS bundle project...........................................................................................30 Updating the project build path........................................................................................................... 32 Managing Java dependencies using Maven or Gradle..............................................................................32 Manually importing Java libraries............................................................................................................. 38 Considerations for a shared JVM...............................................................................................................39 Java development using JCICS................................................................................................................. 39 Threads.................................................................................................................................................41 Data encoding.......................................................................................................................................42 JCICS API services and examples....................................................................................................... 42 CICS exception handling in JCICS programs ......................................................................................64 Java development using JCICSX...............................................................................................................71 JCICSX examples................................................................................................................................. 75 Guidance for using OSGi............................................................................................................................ 77 Developing Java applications to run in a Liberty JVM server .................................................................. 79 Java EE and Liberty applications......................................................................................................... 79 Migrating Java EE applications to run in Liberty JVM server ..............................................................85 Linking to a Java EE or Spring Boot application from a CICS program............................................... 86 Java Transaction API (JTA) ................................................................................................................. 95 Java Persistence API (JPA).................................................................................................................. 96 Enterprise JavaBeans (EJB).................................................................................................................98 Java Message Service (JMS)..............................................................................................................106 Java Management Extensions API (JMX) ......................................................................................... 107 Java Authorization Contract for Containers (JACC).......................................................................... 108 Java Authentication Service Provider Interface for Containers (JASPIC)........................................109 iii Java EE Connector Architecture (JCA).............................................................................................. 110 Developing microservices with MicroProfile..................................................................................... 122 Spring Boot applications....................................................................................................................131 Liberty web server plug-in................................................................................................................. 138 Liberty features........................................................................................................................................138 Accessing data from Java applications ..................................................................................................158 Interacting with structured data from Java............................................................................................ 159 Developing Java applications to use the JZOS Toolkit API in an OSGi JVM server............................... 160 Accessing IBM MQ from Java programs ................................................................................................ 162 Using IBM MQ classes for JMS in a CICS Liberty JVM server .......................................................... 163 Using IBM MQ classes for JMS in an OSGi JVM server .................................................................... 166 Using IBM MQ classes for Java in an OSGi JVM server ....................................................................170 Connectivity from Java applications in CICS ......................................................................................... 171 JCA local ECI support..............................................................................................................................172 Packaging existing applications to run in a JVM server..........................................................................172 Moving applications to a JVM server................................................................................................. 172 Converting an existing Java project to a plug-in project...................................................................173 Importing the contents