Java EE Connector Architecture (JCA)
JCA connects enterprise information systems such as CICS®, to the JEE platform.
JCA supports the qualities of service for security credential management, connection pooling and transaction management, provided by the JEE application server. Using JCA ensures these qualities of service are managed by the JEE application server and not by the application. This means the programmer is free to concentrate on writing business code and need not be concerned with quality of service. For information about the provided qualities of service and configuration guidance see the documentation for your JEE application server. JCA defines a programming interface called the Common Client Interface (CCI). This interface can be used with minor changes to communicate with any enterprise information system.
The programming interface model
ConnectionFactory cf = <Lookup from JNDI namespace>
Connection c = cf.getConnection(ConnectionSpec);
Interaction i = c.createInteraction();
InteractionSpec is = newInteractionSpec();
i.execute(spec, input, output);
i.close();
c.close();
- Use the ConnectionFactory object to create a connection object.
- Use the Connection object to create an interaction object.
- Use the Interaction object to run commands on the enterprise information system.
- Close the interaction and the connection.
If you are using a JEE application server, you create the connection factory by configuring it using the administration interface of the server. In the Liberty server this is defined through the server.xml configuration. When you have created a connection factory, enterprise applications can access it by looking it up in the JNDI ( Java™ Naming Directory Interface). This type of environment is called a managed environment, and allows a JEE application server to manage the qualities of service of the connections. For more information about managed environments see your JEE application server documentation.
Record objects
Record objects are used to represent data passing to and from the EIS. It is advised that application development tools are used to generate these Records. Rational® Application Developer provides the J2C tooling that allows you to build implementations of the Record interface from specific native language structures such as COBOL copybooks, with in-built support for data marshalling between Java and non- Java data types.
Resource adapter example
You can install a basic example resource adapter and configure instances of the resources it provides, see Configuring and deploying a basic JCA Resource Adapter.
The Common Client Interface
The CCI provides a standard interface that allows developers to communicate with any number of EISs through their respective resource adapters, using a generic programming style. The CCI is closely modeled on the client interface used by Java Database Connectivity (JDBC), and is similar in its idea of Connections and Interactions.