Java: A platform for platforms
Sun's reorg may seem promising to shareholders but it's also a scramble for position. The question now is whether Sun can, or wants to, maintain its hold on Java technology. Especially with enterprise leaders like SpringSource and RedHat investing heavily in Java's future as a platform for platforms

Also see:

Discuss: Tim Bray on 'What Sun Should Do'

Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

Access CICS applications with Spring

JCA support provides the key to connection

  • 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
Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources