background image

Management Contracts

<< Resource Adapter Contracts | Outbound Contracts >>
<< Resource Adapter Contracts | Outbound Contracts >>

Management Contracts

A resource adapter is analogous to a JDBC driver. Both provide a standard API through which
an application can access a resource that is outside the Java EE server. For a resource adapter,
the outside resource is an EIS; for a JDBC driver, it is a DBMS. Resource adapters and JDBC
drivers are rarely created by application developers. In most cases, both types of software are
built by vendors that sell products such as tools, servers, or integration software.
Resource Adapter Contracts
The resource adapter mediates communication between the Java EE server and the EIS by
means of contracts. The application contract defines the API through which a Java EE
component such as an enterprise bean accesses the EIS. This API is the only view that the
component has of the EIS. The system contracts link the resource adapter to important services
that are managed by the Java EE server. The resource adapter itself and its system contracts are
transparent to the Java EE component.
Management Contracts
The J2EE Connector architecture defines system contracts that enable resource adapter life
cycle and thread management.
Life-Cycle Management
The Connector architecture specifies a life-cycle management contract that allows an
application server to manage the life cycle of a resource adapter. This contract provides a
mechanism for the application server to bootstrap a resource adapter instance during the
instance's deployment or application server startup. It also provides a means for the application
server to notify the resource adapter instance when it is undeployed or when an orderly
shutdown of the application server takes place.
Work Management Contract
The Connector architecture work management contract ensures that resource adapters use
threads in the proper, recommended manner. It also enables an application server to manage
threads for resource adapters.
Resource adapters that improperly use threads can create problems for the entire application
server environment. For example, a resource adapter might create too many threads or it might
not properly release threads it has created. Poor thread handling inhibits application server
shutdown. It also impacts the application server's performance because creating and destroying
threads are expensive operations.
The work management contract establishes a means for the application server to pool and reuse
threads, similar to pooling and reusing connections. By adhering to this contract, the resource
adapter does not have to manage threads itself. Instead, the resource adapter has the application
Resource Adapter Contracts
Chapter 35 · Connector Architecture
1021