The J2EE Connector Architecture provides a standardized way to connect an application component with Enterprise Information Systems (EISs). Examples of an EIS include a legacy-database system, an ERP system, or a transaction-processing system.
To provide standardized communication between the application component and the EIS, the J2EE Connector Architecture defines the following:
The following sections describe each of these standards in more detail.
The resource adapter enables application components to communicate with an EIS. The application component sends requests for the EIS to the resource adapter. The resource adapter communicates directly with the EIS, returning any requested information to the application component. The application component and resource adapter communicate with each other through the Common Client Interface (CCI). CCI is a standard client API that the J2EE Connector Architecture specification 1.0. defines. Through CCI, an application component can request the following tasks from the resource adapter:
As both Figure 2 and Figure 3 show, the application component and the resource adapter use CCI calls to communicate.
The resource adapter communicates directly with the EIS through the EIS-specific API. It implements the CCI interfaces through calls to this EIS-specific API. By isolating the EIS-specific API calls to the resource adapter, application components do not need to know this API. Instead, the application component uses the high-level CCI calls to request EIS services through the resource adapter.
Table 1 shows the two environments that the J2EE Connector
Architecture specification 1.0. defines, in which an application
component can access an EIS through a resource adapter.
Table 1. Environments for using a resource adapter to access an EIS
J2EE connector adapter environment | Application component | Description |
---|---|---|
Managed environment | A server-side application component | Contacts an application server, which communicates with the EIS through the resource adapter |
Non-managed environment | A client application | Contacts the resource adapter directly to communicate with the EIS |
The following sections describe each of these environments in more detail.
In a managed environment, an application server provides basic services to J2EE application components that need to access Enterprise Information Systems (EISs). The application component is a server-side module that the application server manages. Examples of managed application components include an Enterprise JavaBean (EJB), a Java Server Page (JSP), or a servlet.
To communicate with an EIS, the client application notifies the appropriate application component in the application server that it needs information. The application server and the application component work together with the resource adapter to establish and manage this connection. The application server is responsible for requesting a connection to the EIS. If a connection is not available, the application server requests one from the resource adapter associated with the EIS. The application component receives a handle for this connection.
The application server can provide interactions with many EISs because the J2EE Connector Architecture specification 1.0. defines system-level contracts, which define the interaction between the application server and the resource adapter. These system-level contracts define the following interactions:
The benefit of accessing an EIS through an application server is that the application component is relieved of the need to know the details of connection management, security management, and transaction management. The application server performs these tasks and enforces them through system contracts, to which both the application server and each resource adapter must adhere.
Figure 2 shows the managed environment of the J2EE Connector Architecture, which uses an application server to manage communication between application components and resource adapters.
Figure 2. Managed environment: Accessing an EIS through an application server
In Figure 2, notice that the system-level contracts define the interactions between the resource adapter and the application server while the CCI defines the interaction between the resource adapter and the application component.
In a non-managed environment, the application component is the client application, which communicates directly with the resource adapter to access Enterprise Information Systems (EISs). Examples of non-managed application components include Java applications and applets. Figure 3 shows the non-managed environment of the J2EE Connector Architecture, in which the client application uses CCI calls to communicate with the resource adapter.
Figure 3. Non-managed environment: accessing an EIS directly
When executing in the non-managed environment, the client application must provide the connection management, security management, and transaction management.