Access CICS applications with Spring
JCA support provides the key to connection
By Thierry Templier, JavaWorld.com, 08/22/05
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
Important enterprises currently have in their information systems many heterogeneous applications that must be integrated
into newly developed applications. Some of these applications are developed on IBM technologies like Customer Information
Control System (CICS) or IMS with the COBOL language. The J2EE Connector Architecture (JCA) specification addresses and unifies
the way to communicate with these kinds of systems.
Some tools offer solutions for encapsulating all the JCA plumbing. Since version 1.2.1, Spring provides a lightweight and
innovative solution for connectors using the CCI (Common Client Interface) API.
In this article, I show how to use Spring's JCA support with the IBM CICS JCA-compliant connectors to execute operations on
a CICS system. First, I briefly describe JCA concepts and the main features supported in Spring. Then, I detail the global
architecture to deploy to allow access to CICS with JCA. Finally, I show how to use Spring's JCA support to develop components
based on CICS accesses, focusing on facilities described in this article.
J2EE Connector Architecture
JCA specifies how to access an EIS (enterprise information system) with Java. Currently, there are two versions of this specification:
- Version 1.0: Only addresses outbound messaging with an EIS. It standardizes the interaction between the client and the connector, and
the contracts between the connector and the provider, which offers pooling, transaction, and security services.
- Version 1.5: Based on the previous version, it introduces inbound messaging to an EIS so the system can now call back the connector.
As the IBM CICS connectors used in this article are compliant with JCA 1.0, I do not describe features specific to version
1.5.
JCA 1.0 is divided into two main parts:
- Interactions between the client and the connector: The connector implementation chooses the client API to use. It can be a dedicated one or the CCI API described in the JCA
specification. For example, a JDBC (Java Database Connectivity)
DataSource or a Hibernate SessionFactory can be exposed with a JCA connector.
- Interactions between the connector and the service provider.
The IBM CICS connectors use the CCI API as the client. Its factory abstraction is the ConnectionFactory interface, which resembles the DataSource abstraction for JDBC. It allows the client application to create connections with the EIS. You can get the abstraction in
one of two ways:
- From the JNDI (Java Naming and Directory Interface) of an application server where the connector has been deployed. In this
case, the connector can use its services (pooling, transaction, and security) and is used in a managed mode.
- Directly from a configured instance of the connector's
ManagedConnectionFactory interface implementation. In this case, the connector is used in a nonmanaged mode unless a ConnectionManager implementation is specified when creating the ConnectionFactory with the createConnectionFactory() method.
Listing 1 shows a typical execution of a request with the CCI API.
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
Resources
- Download the source code that accompanies this article
http://www.javaworld.com/javaworld/jw-08-2005/cics/jw-0822-cics.zip
- Reference documentation of the Spring framework
http://static.springframework.org/spring/docs/1.2.x/reference/index.html
- JCA support documentation
http://static.springframework.org/spring/docs/1.2.x/reference/cci.html
- J2EE Connector Architecture
http://java.sun.com/j2ee/connector/
- "Java Connectors for CICSFeaturing the J2EE Connector Architecture," Phil Wakelin, Martin Keen, Richard Johnson, Daniel Cerecedo
Diaz (IBM, March 2002)
http://www.redbooks.ibm.com/abstracts/sg246401.html
- "Revealed! Architecting E-Business Access to CICS," Chris Rayns et al. (IBM Redbooks, February 2005)
http://www.redbooks.ibm.com/abstracts/sg245466.html
- "Connecting WebSphere to CICS with CICS Transaction Gateway," Nigel Williams (IBM, September 2002)
http://www-1.ibm.com/servers/eserver/design_center/websphere_cics.pdf
- "Using J2EE Resource Adapters in a Non-Managed Environment," Kevin Kelle (IBM developerWorks, September 2001)
http://www-106.ibm.com/developerworks/websphere/library/techarticles
/0109_kelle/0109_kelle.html
- "Build JCA-Compliant Resource Adapters with WebSphere Studio Application Developer," Michael McMahon, Mikhail Genkin (IBM developerWorks, August 2003)
http://www-106.ibm.com/developerworks/ibm/library/i-supply1a/
- "Integrating WebSphere Application Server and CICS Using the J2EE Connector Architecture," Phil Wakelin, Nigel Williams (IBM,
January 2004)
http://publibfp.boulder.ibm.com/epubs/pdf/22472180.pdf
- "Transactional Integration of WebSphere Application Server and CICS with the J2EE Connector Architecture," Phil Wakelin, Dave
Seager (IBM developerWorks, August 2004)
http://www-106.ibm.com/developerworks/websphere/techjournal/
0408_wakelin/0408_wakelin.html
- "Accessing CICS Transactions from EJBs," Daniel Would (IBM developerWorks, February 2005)
http://www-106.ibm.com/developerworks/eserver/articles/would_cics.html
- For more articles on Java development tools, browse the Development Tools section of JavaWorld's Topical Index
http://www.javaworld.com/channel_content/jw-tools-index.shtml
- For more articles on J2EE, browse the Java 2 Platform, Enterprise Edition section of JavaWorld's Topical Index
http://www.javaworld.com/channel_content/jw-j2ee-index.shtml?
Archived Discussions (Read only)