Read an Excerpt
Chapter 20: The J2EE Connector Architecture
This chapter presents an introduction to the J2EE Connector Architecture (JCA), a significant new addition to the J2EE platform in version 1.3. JCA is an enterprise application integration initiative providing a standardized architecture to enable J2EE components to have "plug-and-play" access to heterogeneous Enterprise Information Systems (EIS), which include ERP, transaction processing, and legacy database systems.Over the course of this chapter we'll study the J2EE Connector Architecture and develop J2EE Connector components to allow J2EE applications to integrate and interact with backend EIS resources. In particular, we will be focusing on the following:
- EIS integration issues and the role of JCA
- JCA architecture, services, and API
- How JCA works within a J2EE framework
- Programming with the Common Client Interface (CCI)
- Building a JCA component
- The rules that a JCA developer must follow
- How to deploy and test JCA components
- Potential benefits of using JCA
- Current limitations of JCA 1.0
EIS Integration and the Role of JCA
In this age of e-business, Internet-enabling business applications and integrating businesses across the Internet has become fundamental for their competitive advantages. However, prior to the Internet economy, many companies and businesses had already invested heavily in business and management information application systems, such as:- Enterprise Resource Planning (ERP) applications, like SAP R/3 and BAAN.
- Customer Relationship Management (CRM) applications, such as Siebel and Clarify.
- Database applications, such as DB2 and Sybase.
- Mainframe transaction processing applications, such as CICS.
- Legacy Database systems, such as IBM's IMS
An Enterprise Information System (EIS) provides the information infrastructure and services for an enterprise. This information may be in the form of a set of records in a database, business objects in an ERP, a workflow object in a customer relationship management (CRM) system, or a transaction program in a transaction processing application.
Leveraging these complex business applications into a multi-tiered application framework is quite challenging, and implementing them for a high-availability web application is a mammoth project.
Before the Connector Architecture, some application server vendors provided or supported a variety of custom adapters for integrating EIS systems. These adapters basically provided custom native interfaces, which were complex to understand and were limited in that they attempted to support a standard architecture. More specifically, some of these limitations were as follows:
- Application programming for EIS is proprietary in nature, and the sheer variety of application
systems meant there was no generic interface mechanism for integration with open architectures.
- Large-scale web applications require high-availability and scalability in respect of the number
of clients, connection management, etc. Traditionally, the number of clients and their active
connections are expensive in an EIS and custom adapters lack support for connection
management mechanisms provided by application servers.
- Managing security and distributed transactions with multiple backend applications is extremely complex and lacks reliable mechanisms. This meant there was no standard infrastructure solution available to provide a vendor-neutral security mechanism and generic transaction-management support to multiple EIS resource managers. This can pose huge problems with the implementation of EAI.
The J2EE Connector Architecture (JCA) provides an easy approach for developers to seamlessly integrate Enterprise Information Systems (EIS) with J2EE platform components.
The following diagram shows the new face of a J2EE 1.3 application server with JCA components and examples of potential Enterprise Information Systems...
...So, if we need to integrate a J2EE-based application with an existing EIS, all we need to do is install the appropriate EIS connector (a JCA-compliant Resource-adapter) into our application server. With the adapter installed, we can develop J2EE components to interface with the EIS using the Common Client Interface (CCI) API, in the same manner that we can use JDBC to interface with relational databases. In other words, development is simplified by having no EIS-specific programming, and a configuration completely independent of the backend EIS.
The idea is that all application server vendors will eventually implement JCA services and the EIS vendors will implement JCA-compliant EIS resource-adapters. By supporting the J2EE Connector Architecture, all J2EE compliant application servers are assured of handling multiple and heterogeneous EIS resources.
Thus, JCA boosts J2EE application developer's productivity in parallel with reducing development costs and protecting the existing investment in EIS systems by providing a scalable integration solution through J2EE.
J2EE Connector Architecture and its Elements
JCA is implemented in a J2EE 1.3-compliant application server, with a JCA-compliant resource-adapter provided by an EIS vendor. This resource-adapter is an EIS-specific, pluggable J2EE component in the application server, which provides an interface for communicating with the underlying EIS system. Basically JCA defines the following list of elements and service:- System-level contracts and services -define the standard interface between the J2EE
components, the application server provider and the EIS system. These contracts and services
are implemented in the application server by the J2EE server provider and also in the resource-adapter
by the EIS vendor. The implementation of contacts and services defines a logical
separation (not physical) between the application server and the resource-adapter in terms of
system-level roles and responsibilities. This allows the J2EE server and the resource-adapter to
co-ordinate with each other (for example, connection pooling, security, and transactions).
Furthermore, it enables a JCA-compliant resource-adapter to be pluggable into any J2EE server.
- The JCA Common Client Interface (CCI) -defines a client API that J2EE components (like
JSPs, EJBs, etc.) can use to connect to and interact with EIS systems. In addition to J2EE client
components, it also allows non-managed applications (like Java applets and application
clients) to integrate with an EIS using a JCA-compliant resource-adapter.
- Packaging and deployment interfaces -allow various EIS resource adapters to plug into J2EE applications.
...The resource-adapter can clearly be seen as the fundamental component of the JCA, as it serves as the central connector between the J2EE components, the application server, and the EIS system.
In a J2EE application framework using JCA, EIS vendors provide JCA-compliant resource-adapters with CCI as a part of their implementation. J2EE server vendors provide application servers supporting JCA system-level contracts that enable these resource-adapters to plug into the application servers and provide connectivity with underlying EIS resources. This allows the J2EE application developers to develop integration components using CCI. They are therefore able to stay away from the connection, security, and transaction mechanisms meant for connectivity with an EIS or multiple EIS resources.
The JCA specification supports two types of environments, based on which type of client application uses the resource-adapter:
- Managed Environment
Defines a multi-tier, web-enabled, J2EE-based application that accesses EIS(s). The application may contain one or more application components (for example, EJBs, JSP pages, servlets), which are deployed on their respective containers. In the context of JCA, these applications are referred as managed applications. - Non-managed Environment
The connector architecture supports access to EIS(s) from clients like applets or Java client applications. Typically it is in a two-tier architecture where an application client directly uses a resource-adapter library. In this case the resource-adapter provides low-level transactions and security to its clients. In a JCA context, these applications are referred as non-managed applications.
Comparing JCA with JDBC
In general, JCA and JDBC are similar technologies with identical mechanisms with respect to connection and transaction management.
Resource-adapters for EIS systems are analogous to JDBC drivers for relational databases.
The following table presents a comparison between JCA and JDBC, and demonstrates the similarities (and differences) between the two...
...So, after the comparison, the difference between the two technologies is clear -JDBC provides drivers and a client API for connection and integration with relational database applications, whereas the JCA provides resource-adapters and a client API (CCI) to enable seamless integration to EIS resources....