The programming interface model

Applications that use the CCI have a common structure for all enterprise information systems. The JCA defines connections and connection factories that represent the connection to the EIS. These connection objects allow a JEE application server to manage the security, transaction context and connection pools for the resource adapter.

An application must start by accessing a connection factory from which a connection can be acquired. The properties of the connection can be overridden by a ConnectionSpec object. The ConnectionSpec class is specific to CICS and can be either an ECIConnectionSpec or an EPIConnectionSpec.

After a connection has been acquired, an interaction can be created from the connection to make a particular request. The interaction, like the connection, can have custom properties which are set by the InteractionSpec class (ECIInteractionSpec or EPIInteractionSpec) which is specific to CICS. To perform the interaction, call the execute() method and use record objects, which are specific to CICS, to hold the data. For example:
			/* Obtain a ConnectionFactory cf */
			Connection c = cf.getConnection(ConnectionSpec)
			Interaction i = c.createInteraction()
			InteractionSpec is = newInteractionSpec();
			i.execute(spec, input, output)	

If you are using a JEE application server, you create the connection factory by configuring it using an administration interface such as the WebSphere administrative console. You set custom properties such as the Gateway daemon connection URL. 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.

If you are not using a JEE application server, you must create a managed connection factory and set its custom properties. You can then create a connection factory from the managed connection factory. This type of environment is called a nonmanaged environment and does not allow a JEE application server to manage the qualities of service of connections.