Using CICS Liberty JVM servers to develop application interfaces
This chapter describes how to implement the modernization of presentation in IBM CICS Transaction Server (TS) with CICS Liberty Java virtual machine (JVM) server. We include scenarios to develop CICS Liberty JVM server applications to gain the benefit of IBM CICS Transaction Server for z/OS Value Unit Edition and the features that the Liberty JVM server provides to run the presentation logic. We also introduce a toolkit to migrate an existing Java application from other platforms to CICS Liberty JVM server.
This chapter covers the following topics:
3.1 CICS Liberty JVM server scenarios
Before CICS Liberty JVM server, CICS TS supported the 3270 screen and the web as the presentation interfaces, with CICS TS Basic Mapping Support (BMS), CICS TS Web Support (CWS), or CICS TS Dynamic Scripting Feature Pack.
The 3270 screen is a traditional mainframe interface that is not as modern as a web or mobile interface. There are many requirements from IBM clients who use CICS TS to replace the 3270 screen with web browser and RESTful clients.
CICS TS Web Support can work with web applications, but the application programmers need to use CICS TS web APIs to analyze the HTTP data and to assemble the HTTP response. Web applications are typically no longer developed in this way.
The Dynamic Scripting feature pack was originally included with CICS Transaction Server for z/OS Version 4 Release 1. It supports the use of PHP and Groovy to develop situational applications. In CICS Transaction Server for z/OS Version 5 Release 1, the Dynamic Scripting feature pack runs in CICS Liberty JVM server and it only supports PHP. We explain more in 3.2, “CICS Liberty JVM server features for the presentation layer” on page 28.
There are other third-party presentation technologies used to connect to CICS TS. Some CICS TS customers are eager to modernize these client connectors with web front end (servlets).
CICS Liberty JVM server is the preferred way to develop web applications in CICS TS or to handle RESTful request. All Java workloads deployed using CICS Liberty are candidates for approval for IBM CICS Transaction Server for z/OS Value Unit Edition.
There are two typical scenarios for customers to use CICS Liberty JVM server:
Development of a Java solution for a new business requirement or replacement
Replacement of an older presentation layer with a modern presentation layer
3.1.1 Scenario one
The first scenario is that a customer wants to develop a pure Java solution either for a new business requirement or as a replacement of existing solution. The Java solution includes presentation logic, business logic and data access logic. In this case, everything can be deployed and run in a zNALC-enabled LPAR.
In Figure 3-1 on page 27, we show a general architecture for this scenario. We have a CICS TS region running in a zNALC-enabled LPAR. In the region, we set up a JVM server for CICS Liberty JVM server. We develop an application with presentation and application interfaces, business logic, and data access. In the presentation layer, you can use the features that CICS Liberty JVM server provides. For more information, see 3.2, “CICS Liberty JVM server features for the presentation layer” on page 28.
Figure 3-1 Presentation, business logic, and data access in CICS Liberty JVM server
To develop and deploy a CICS TS application, the CICS TS Explorer SDK is a preferred tool. It can be downloaded at no charge from the IBM website and installed in an Eclipse integrated development environment (IDE). The development process is similar to the process used to develop a Liberty project for a distributed platform. To access the data, CICS TS provides the JCICS API support.
After the development work is done, the Java web application, either in the form of WAR files or an EBA file, can be deployed as one or more CICS TS bundles in a z/OS file system (zFS). If there are common Java classes to be shared by multiple versions of different Java web applications, you can deploy these classes as common OSGi bundles to zFS directories and refer to these directories from a bundleRepository element of the server.xml file of the Java web applications.
For more information about how to develop Java applications in CICS Liberty JVM server, see Chapter 4, “Porting JEE applications to a CICS Liberty JVM server” on page 33.
3.1.2 Scenario two
Another scenario is that there is a need to replace older presentation layers (for example, BMS) with a more modern presentation layer, such as a web or RESTful interface. In this case, existing business logic and data access can be reused. You can develop and deploy the new presentation layer in CICS Liberty JVM server that runs in a zNALC-enabled LPAR. The presentation layer can then link to the existing business logic, which is still in a standard z/OS LPAR. Figure 3-2 on page 28 shows the architecture for this scenario.
.
Figure 3-2 Presentation in CICS Liberty JVM server and link to existing business logic
The development and deployment in this scenario is the same as the previous scenario. The difference is that we focused on only the presentation layer. To communicate with an existing business logic in another CICS region, distributed program link (DPL) is a preferred way. Channels and containers and COMMAREA are both supported to carry the data.
Many existing CICS TS applications are centered on the use of structured data records, which are typically stored as sequential files in the Virtual Storage Access Method (VSAM) data set or as DB2 tables. To communicate with these existing applications, it is frequently desirable to reuse the copybooks, which describe these existing record structures. To simplify the interactions from the Java application with the structured data required by the existing CICS TS applications, IBM provides utilities such as JZOS and J2C to make the task easier. For more information about how to use JZOS and J2C, see Chapters 8 in the IBM Redbooks publication titled IBM CICS and the JVM server: Developing and Deploying Java Applications, SG24-8038:
3.2 CICS Liberty JVM server features for the presentation layer
CICS TS uses some of the features in the WebSphere Application Server Liberty Profile to run the following in a JVM server:
Web applications JavaServer Pages (JSP), JavaServer Faces (JSF), and so on
Web services Java API for XML Web Services (JAX-WS) and Java Architecture for XML Binding (JAXB)
RESTful services JavaScript Object Notation (JSON) and Java API for RESTful Web Services (JAX-RS)
For a list of features that CICS TS V5.2 supports, see “Liberty features” in the IBM Knowledge Center:
In this section, we briefly introduce the Liberty features that CICS support for the presentation layer. As mentioned, these features are from the WebSphere Application Server Liberty profile. For more information about how to use these features, see the IBM Redbooks publication titled WebSphere Application Server Liberty Profile Guide for Developers, SG24-8076:
3.2.1 JavaServer Pages 2.2
JavaServer Pages (JSP) are a widely used technology to easily create dynamic web pages based on HTML, XML, or other document types. JavaServer Pages enable the separation of the Hypertext Markup Language (HTML) code from the business logic in web pages so that HTML programmers and Java programmers can more easily collaborate in creating and maintaining pages.
CICS Liberty JVM server supports the JavaServer Pages 2.2 specification. For more information about JSP and how to develop JSP in the Liberty profile, see “Developing JSP files” in the IBM Knowledge Center:
3.2.2 JavaServer Faces 2.0
JavaServer Faces (JSF) simplify the development of user interfaces for web applications by providing the following features:
Templates to define the layout
Composite components that turn a page into a JSF UI component
Custom logic tags
Expression functions and validation
Component libraries
XHTML page development
For more information, see “JavaServer Faces” in the IBM Knowledge Center:
3.2.3 Java Servlet 3.0
Java servlets are a widely used technology for building dynamic content for web-based applications. The servlet Java classes are used to extend the capabilities of a server, commonly a web server.
CICS Liberty JVM server provides support for HTTP servlets written to the Java Servlet 3.0 specification. For more information about developing servlets, see the following website:
3.2.4 JavaScript Object Notation 1.0
The JavaScript Object Notation (JSON4J) library is an implementation of a set of JavaScript Object Notation (JSON) handling classes for use within Java environments.
The JSON4J library provides the following functions:
A simple Java model for constructing and manipulating data to be rendered as the JSON implementation.
A fast transformation of XML for JSON conversion for situations where you want conversion from an XML reply from a web service to a JSON structure for easy use in Asynchronous JavaScript and XML (Ajax) applications.
A JSON string and stream parser that can generate the corresponding JSONObject, which represents that JSON structure in Java. You can then change that JSONObject and serialize the changes back to the JSON implementation.
CICS Liberty JVM server provides access to the JSON4J library, which includes a set of JSON handling classes for Java environments. For more information, see “JavaScript Object Notation (JSON4J)” in the IBM Knowledge Center:
JSON4J can be used to connect mobile devices to CICS TS. For more information, see Chapter 5, “Connecting mobile devices to CICS Transaction Server” on page 47.
3.2.5 Java API for RESTful Web Services
Java API for RESTful Web Services (JAX-RS) is a technology to develop services that follow Representational State Transfer (REST) principles. RESTful services are based on manipulating resources. Resources can contain static or dynamically updated data. By identifying the resources in your application, you can make the service more useful and easier to develop.
CICS Liberty JVM server provides support for the Java API for RESTful Web Services on the Liberty profile. For more information about JAX-RS, see “Developing web services - RESTful services” in the IBM Knowledge Center:
JAX-RS can also be used to connect the mobile device to CICS TS. For more information, see Chapter 5, “Connecting mobile devices to CICS Transaction Server” on page 47.
3.2.6 Java API for XML Web Services 2.2
Java API for XML-based Web Services (JAX-WS) is the next-generation web services programming model. Using JAX-WS, development of web services and clients is simplified, with more platform independence for Java applications, by the use of dynamic proxies and Java annotations.
CICS Liberty JVM server supports SOAP web services that are based on JAX-WS 2.2. For more information, see “JAX-WS” in the IBM Knowledge Center:
JAX-WS can also be used to connect the mobile t CICS TS. For more information, see Chapter 5, “Connecting mobile devices to CICS Transaction Server” on page 47.
3.2.7 Java Architecture for XML Binding 2.2
Java Architecture for XML Binding (JAXB) is a Java technology that provides an easy and convenient way to map Java classes and XML schema for simplified development of web services. JAXB leverages the flexibility of platform-neutral XML data in Java applications to bind XML schema to Java applications without requiring extensive knowledge of XML programming. JAXB provides the XJC schema compiler tool and the schemagen schema generator tool to transform between XML schema and Java classes.
CICS TS provides JAXB support to map between Java classes and XML representations. For more information, see “JAXB” see in the IBM Knowledge Center:
JAXB can also be used to connect the mobile device to CICS TS. For more information, see Chapter 5, “Connecting mobile devices to CICS Transaction Server” on page 47.
3.2.8 Bean Validation 1.0
It is always quite important to validate input received from the user to maintain data integrity in application logic. For example, it is necessary to validate the input of an email address before sending email. Bean Validation is a new validation model that is available as part of the Java Enterprise Edition 6 platform. The model is supported by constraints in the form of annotations placed on a field, method, or class of a JavaBeans component.
The Bean Validation API is introduced as a standard mechanism to validate enterprise JavaBeans in all layers of an application, including presentation, business, and data access. Before the Bean Validation specification, the JavaBeans were validated in each layer. To prevent the reimplementation of validations at each layer, developers bundled validations directly into their classes or copied validation code, which was often cluttered. Having one implementation that is common to all layers of the application simplifies the developer’s work and saves time.
With Bean Validation, CICS Liberty JVM server provides validations for JavaBeans at each layer of an application. For details, see “Bean Validation” in the IBM Knowledge Center:
3.2.9 PHP support by Dynamic Scripting Feature Pack
PHP support is a feature provided by CICS TS Transaction Server Feature Pack for Dynamic Scripting V2.0, not the WebSphere Application Server Liberty profile. The feature pack provides an agile web application platform for developing and running modern web applications. You can use the Feature Pack for Dynamic Scripting V2.0 to create and run PHP applications that meet your specific needs or the needs of your clients. For more information, see “CICS Transaction Server for z/OS Feature Pack for Dynamic Scripting V2.0” in the IBM Knowledge Center:
3.3 Migrate existing Java presentation logic to CICS Liberty JVM server
The WebSphere Application Server V8.5.5 Liberty profile provides a simple tool to analyze what Java API packages are supported according to feature. For example, the following command produces an XML file that shows all of the API packages for each feature, which can be cross-checked against the Liberty features supported in CICS TS:
$USSHOME/wlp/bin/featureManager featureList --encoding=ibm037/tmp/wlp855_featureList.xml
Migrating a Java application from one platform to another is easier than the migrating applications developed in other languages. If you have existing Java presentation logic outside of CICS TS and want to migrate the logic to CICS Liberty JVM server, the IBM WebSphere Application Server Migration Toolkit can make the migration easier.
 
Note: Make sure that the features used in existing Java applications are supported by CICS Liberty.
The WebSphere Application Server Migration Toolkit is a suite of tools and collections of knowledge that enable your organization to quickly and cost-effectively migrate to WebSphere Application Server V7.0 through V8.5.5, whether from a previous version of WebSphere Application Server or competitive application servers, including Apache Tomcat Server, JBoss Application Server, Oracle Application Server, and Oracle WebLogic Server.
For more information, see the “IBM WebSphere Application Server Migration Toolkit” page on IBM developerWorks®:
The Migration Toolkit can help you complete part of the migration, but not all. You still need to tailor your application to make it work within CICS. For example, the data access in mainframe is quite different from that in a distributed platform. You might need to move some recoverable application data to VSAM or DB2, and then use the JCICS API or JDBC to access to the data. For more information, see Chapter 4, “Porting JEE applications to a CICS Liberty JVM server” on page 33.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.95.60