JCA Overview


J2EE 1.4 contains a connector architecture specification called JCA that allows for the integration of transacted and secure resource adaptors into a J2EE application server environment. The JCA specification describes the notion of such resource managers as enterprise information systems (EISs). Examples of EISs include enterprise resource planning packages, mainframe transaction processing, and non-Java legacy applications.

The reason for focusing on EIS is primarily because the notions of transactions, security, and scalability are requirements in enterprise software systems. However, the JCA is applicable to any resource that needs to integrate into JBoss in a secure, scalable, and transacted manner. This section focuses on resource adapters as a generic notion rather than something specific to the EIS environment.

The JCA defines a standard service provider interface (SPI) for integrating the transaction, security, and connection-management facilities of an application server with those of a resource manager. The SPI defines the system-level contract between the resource adaptor and the application server.

The JCA also defines a common client interface (CCI) for accessing resources. The CCI is targeted at EIS development tools and other sophisticated users of integrated resources. The CCI provides a way to minimize the EIS-specific code required by such tools. Typically, J2EE developers access a resource by using such a tool or a resource-specific interface rather than using CCI directly. The reason is that the CCI is not a type-specific API. To be used effectively, CCI must be used in conjunction with metadata that describes how to map from the generic CCI API to the resource manager-specific data types used internally by the resource manager.

The purpose of the JCA is to enable a resource vendor to provide a standard adaptor for its product. A resource adaptor is a system-level software driver that a Java application uses to connect to a resource. The resource adaptor plugs into an application server and provides connectivity between the resource manager, the application server, and the enterprise application. A resource vendor need only implement a JCA-compliant adaptor once to allow use of the resource manager in any JCA-capable application server.

An application server vendor extends its architecture once to support the JCA and is then assured of seamless connectivity to multiple resource managers. Likewise, a resource manager vendor provides one standard resource adaptor, and it has the capability to plug in to any application server that supports the JCA.

Figure 7.1 illustrates that the application server is extended to provide support for the JCA SPI to allow a resource adaptor to integrate with the server connection pooling, transaction management, and security management facilities. This integration API defines a three-part system contract:

  • Connection management This contract allows the application server to pool resource connections. The purpose of this pool management is to allow for scalability. Resource connections are typically expense objects to create, and pooling them allows for more effective reuse and management.

  • Transaction management This contract allows the application server transaction manager to manage transactions that engage resource managers.

  • Security management This contract enables secured access to resource managers.

Figure 7.1. The relationship between a J2EE application server and a JCA resource adaptor.


The resource adaptor implements the resource manager side of the system contract. This entails using the application server connection pooling, providing transaction resource information, and using the security integration information. The resource adaptor also exposes the resource manager to the application server components. This can be done using the CCI and/or a resource adaptor-specific API.

The application component integrates into the application server by using a standard J2EE container-to-component contract. For an EJB component, this contract is defined by the EJB specification. The application component interacts with the resource adaptor in the same way it would with any other standard resource factory, such as a javax.sql.DataSource JDBC resource factory. The only difference with a JCA resource adaptor is that the client has the option of using the resource adaptor-independent CCI API if the resource adaptor supports this.

Figure 7.2 (from the JCA 1.5 specification) illustrates the relationship between the JCA architecture participants in terms of how they relate to the JCA SPI, CCI, and JTA packages.

Figure 7.2. The JCA 1.5 specification class diagram for the connection management architecture.


The JBossCX architecture provides the implementation of the application server-specific classes. Figure 7.2 shows that this comes down to the implementation of the javax.resource.spi.ConnectionManager and javax.resource.spi.ConnectionEventListener interfaces. The key aspects of this implementation are discussed in the following section.



JBoss 4. 0(c) The Official Guide
JBoss 4.0 - The Official Guide
ISBN: B003D7JU58
EAN: N/A
Year: 2006
Pages: 137

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net