The following sections introduce WebLogic resource adapters, the BEA WebLogic Server implementation of the J2EE Connector Architecture:
A resource adapter is a system library specific to an Enterprise Information System (EIS) and provides connectivity to an EIS; a resource adapter is analogous to a JDBC driver, which provides connectivity to a database management system. The interface between a resource adapter and the EIS is specific to the underlying EIS; it can be a native interface. The resource adapter plugs into an application server, such as WebLogic Server, and provides seamless connectivity between the EIS, application server, and enterprise application.
Multiple resource adapters can plug in to an application server. This capability enables application components deployed on the application server to access the underlying EISes. An application server and an EIS collaborate to keep all system-level mechanisms—transactions, security, and connection management—transparent to the application components. As a result, an application component provider can focus on the development of business and presentation logic for application components and need not get involved in the system-level issues related to EIS integration. This leads to an easier and faster cycle for the development of scalable, secure, and transactional enterprise applications that require connectivity with multiple EISes.
It is important to note the difference between BEA WebLogic Integration (WLI) resource adapters and BEA WebLogic Server resource adapters. WebLogic Integration resource adapters are written to be specific to WebLogic Server and, in general, are not deployable to other application servers. However, WebLogic Server resource adapters written without WLI extensions are deployable in any J2EE-compliant application server. This document discusses the design and implementation of non-WLI resource adapters. For more information on WebLogic Integration resource adapters, see BEA WebLogic Adapter 8.1 Documentation.
WebLogic Server supports three types of resource adapters:
Outbound resource adapters based on the J2EE 1.5 Connector Architecture can be configured to have more than one simultaneous outbound connection. You can configure each outbound connection to have its own WebLogic Server-specific authentication and transaction support. See Configuring Outbound Connections.
|Note:||The WebLogic Server thin-client JAR also supports the WorkManager contracts and thus can be used by non-managed resource adapters (resource adapters not running in WebLogic Server.)|
WebLogic Server supports resource adapters developed under either the J2EE 1.0 Connector Architecture or the J2EE 1.5 Connector Architecture. The J2EE 1.0 Connector Architecture restricts resource adapter communication to a single external system using one-way outbound communication. The J2EE 1.5 Connector Architecture lifts this restriction. Other capabilities provided by and for a 1.5 resource adapter that do not apply to 1.0 resource adapters include:
Workinstances. See work-manager.
stop()methods of the resource adapter by the application server. See Programming a Resource Adapter to Perform as a Startup Class.
Another important difference between 1.0 resource adapters and 1.5 resource adapters has to do with connection pools. For 1.5 resource adapters, you do not automatically get one connection pool per connection factory; you must configure a connection instance. You do so by setting the
connection-instance element in the
weblogic-ra.xml deployment descriptor.
Although WebLogic Server is now compliant with the J2EE 1.5 Connector Architecture, it continues to fully support the J2EE 1.0 Connector Architecture. In accordance with the J2EE 1.5 Connector Architecture, WebLogic Server now supports schema-based deployment descriptors. Resource adapters that have been developed based on the J2EE 1.0 Connector Architecture use Document Type Definition (DTD)-based deployment descriptors. Resource adapters that are built on DTD-based deployment descriptors are still supported.
This document describes the development and use of 1.5 resource adapters. For more information on WebLogic Server resources adapters that are based on the J2EE 1.0 Connector Architecture, see the BEA WebLogic Server 8.1 version of Programming WebLogic Resource Adapters.
The J2EE Connector Architecture defines a standard architecture for connecting the J2EE platform to heterogeneous Enterprise Information Systems (EISes), such as Enterprise Resource Planning (ERP) systems, mainframe transaction processing (TP), and database systems
The resource adapter serves as a protocol adapter that allows any arbitrary EIS communication protocol to be used for connectivity. An application server vendor extends its system once to support the J2EE Connector Architecture and is then assured of seamless connectivity to multiple EISes. Likewise, an EIS vendor provides one standard resource adapter that can plug in to any application server that supports the J2EE Connector Architecture.
For a more detailed overview of the J2EE Connector Architecture, see Section 3 “The Connector Architecture” of the.
Figure 2-1 and the discussion that follows describe a WebLogic Server implementation of the J2EE 1.5 Connector Architecture.
The connector architecture shown indemonstrates a bi-directional resource adapter. The following components are used in outbound connection operations:
ManagedConnectionFactory(in this case, MCF-2—there may be more corresponding to different types of connections to a single EIS or even different EISes)
The following components are used for inbound connection operations:
MessageEndpointFactorycreated by the EJB container and used by the resource adapter for inbound messaging to create proxies to
MessageEndpointinstances (MDB instances from the MDB pool).
To achieve a standard system-level pluggability between WebLogic Server and an EIS, WebLogic Server has implemented the standard set of system-level contracts defined by the J2EE Connector Architecture. These contracts consist of SPI classes and interfaces that are required to be implemented in the application server and the EIS, so that the two systems can work cooperatively. The EIS side of these system-level contracts are implemented in the resource adapter’s Java classes. The following standard contracts are supported:
These system-level contracts are described in detail in the.
The structure of a resource adapter and its run-time behavior are defined in deployment descriptors. Programmers create the deployment descriptors during the packaging process, and these become part of the application deployment when the application is compiled.
WebLogic Server resource adapters have two deployment descriptors, each of which has its own XML schema:
ra.xml—The standard J2EE deployment descriptor. All resource adapters must be specified in an
ra.xmldeployment descriptor file. The schema for
weblogic-ra.xml—This WebLogic Server-specific deployment descriptor contains elements related to WebLogic Server features such as transaction management, connection management, and security. This file is required for the resource adapter to be deployed to WebLogic Server. The schema for the
weblogic-ra.xmldeployment descriptor file is . For a reference to the
weblogic-ra.xmldeployment descriptor, see weblogic-ra.xml Schema.