Understanding JCA Resource Adapters

If JCA is the platform as well as the standard, then JCA resource adapters are the applications that run in that environment. Resource adapters, as we covered briefly above, provide the translation and connectivity information that account for the differences between how the EIS communicates outside itself, and the way JCA needs to communicate to allow for interoperability.

To comply with JCA, all JCA resource adapters and J2EE containers must support system-level contracts. If you remember, a contract defines the rules of the application and the implementation of the interface. What's more, JCA asks that all resource adapters support CCI as their client API, providing a J2EE-based programmatic access to the EIS.

There are two types of contracts: application contracts and system-level contracts. Application contracts define the CCI API, or the interface that the J2EE client component (managed or nonmanaged) uses to communicate with the EIS. System-level contracts, as the name implies, enable the resource adapters to connect with the system services found in the J2EE container. This allows the resource adapter to manage low-level functions such as transactions and security.

An instance of a service contract is connection management, which enables J2EE containers to provide their own services to create and manage EIS connection pools. The purpose of this service is to ensure that there are enough connections to allow for the JCA application integration solution to scale.

The connection management contract provides a consistent application programming practice to create connections for both managed and nonmanaged applications. It also enables CCI-based connection factory and connection interfaces, as well as provides a generic mechanism for J2EE-managed components (security, error handling, etc.). Finally, connection management provides support for connection pooling services that leverage the J2EE container.

What's the Difference Between XA and Local Transactions?

XA transactions support JTA XA resource-based transaction management with JCA-compliant resource adapters. This means that the XA resource interface is implemented through the respective resource adapter. XA transactions allow a transaction to be managed by a single transaction manager that exists outside the domain of the resource adapter.

Local transactions are managed by the J2EE container or sometimes through a J2EE component. Using the JTA UserTransaction interface or the transaction API specific to the EIS, the J2EE container is able to manage resources local to the application and the respective resource adapter.

Another type of service contract is transaction management, which extends the J2EE container's transactional middleware capabilities to the resource manager. It's the job of the resource manager to manage the shared EIS resources, specifically, transactions that are managed by the external transaction manager and transactions managed internally that do not interact with external resources.

This is a powerful component of JCA because you can manage transactions across many EIS resource managers, including support for XA transactions and local transactions.



Next Generation Application Integration(c) From Simple Information to Web Services
Next Generation Application Integration: From Simple Information to Web Services
ISBN: 0201844567
EAN: 2147483647
Year: 2005
Pages: 220

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