Implement "Plug and Play" for enterprise applications through JCA

Source: Internet
Author: User
Tags connect resource

For companies with multiple enterprise information systems, integrating these enterprise information systems is essential to achieving the highest efficiency. The JCA (Java Connector architecture) provides a standard Java solution for Application Server and enterprise Information system connectivity, and a way to integrate these systems to achieve the best productivity. Because Java EE's support for enterprise-class application integration is already very small (essentially, JMS and XML can be supported using the Jax Application programming Interface), Sun and its Community process Buddy recommends that the EE Connector Architecture (Java EE Connector Architecture, JCA) as part of the 1.3 version of the Java EE specification. Because JCA provides a standard set of architectures for consolidating different kinds of enterprise information systems, the enterprise information systems vendors that use it no longer need to customize their products for each application server. Application server vendors adhering to this specification will not need to add custom code when they want to add a new enterprise information system connection. The best thing is that users who need access to an enterprise information system product from a Java EE application do not need to learn or learn different application programming interfaces, because JCA defines a common set of client interfaces.

JCA Insider

JCA defines a standard set of interfaces that allow connectors to seamlessly integrate compatible application servers. At the same time, another set of standard interfaces allows customers (or application hosts of application servers) to use connectors in a uniform way. This means that the JCA connector is portable across application servers, and the client program is a lightweight connector.

Connectors that adhere to the JCA specification are called Resource Adapters (resource adapter). Each resource adapter is required to support two standard interfaces: a set of interfaces that are used by the application server to interact with the adapter, while the other is used by customers/consumers to interact with the enterprise information System (and, of course, through adapters).

JCA considers that the resource adapter can replace the client program as a proprietary interface, but this may change in subsequent versions. I strongly recommend that you always support standard clients. There's really not much extra work to do, as I'll demonstrate in this example resource adapter. But before we go into this example, let's look at the system-client interface. Each resource adapter that adheres to the JCA specification must support a set of standard interfaces that application servers use to manage adapters. This set of interfaces is a system-level compact between the adapter and the application server, which is delegated by the JCA.

An application server can have multiple resource adapters, but each enterprise-level information system type has only one adapter. For example, an application server can allocate a resource adapter for sap,oracle. The application server and resource adapter relationships closely manage the three key aspects of enterprise information system access: connectivity, transactions, and security. To this end, JCA defines a set of standard interfaces, defined in the JAVAX.RESOURCE.SPI and javax.resource.spi.security packages, that all resource adapters must implement. These interfaces allow application servers to interact with resource adapters and control the handling of connections, transactions, and security management.

Creating a resource adapter The first step is to implement the system contract correctly, and it brings many benefits, and we illustrate one of the benefits by using a resource adapter with a connection management contract that enables the application server to connect to a basic enterprise-level information system. This enables a scalable application environment to support many customers who need access to enterprise-level information systems.

Another benefit can be achieved by implementing transaction management agreements, which support transactional access to enterprise-level information system resource managers. This agreement enables an application server to use a matter manager to manage transactions between multiple resource managers. For example, this would allow a transaction session bean to access a relational database through a Java database connection (JDBC) and an SAP system in the same transaction controlled by an application server. The transaction agreement also supports transactions that are managed internally by an enterprise-level Information System Resource management program, that is, local transactions, without having to deal with enterprise external transaction management.

Another benefit is to take full account of security protocols that access enterprise-level information systems. This agreement provides support for a secure application environment, reduces the likelihood of threats to the security of information systems, and can also protect commercially valuable information resources managed by information systems.

These benefits are available to the application server's resource adapters without having to write any custom code. This greatly stimulates the provider of enterprise information systems to create advanced resource adapters for the system.

In addition, JCA defines another set of interfaces that customers/consumers use to interact with the enterprise information System. The JCA invokes the public client interface (Common client Interface,cci). CCI is an application developer and client program interface that can connect and access back-end systems together. It is a low-end API similar to JDBC. CCI manages the flow of data between applications and systems without allowing us to see what the container and application servers do. CCI is designed for some particular purpose. First, it can span many types of enterprise information systems, and secondly, the application interface is designed to be very easy-to-use and extensible. CCI can further build a more specific enterprise information system function.

The CCI is divided into four parts (see table 1). All the specific CCI classes and interfaces can be conveniently found in the Javax.resource.cci package.

The
interface type name
javax.resource.cci.connectionfactory

Javax.resource.cci.Connection

Javax.resource.cci.ConnectionSpec

Javax.resource.cci.LocalTransaction
javax.resource.cci.interaction

Javax.resource.cci.InteractionSpec
javax.resource.cci.recordfactory

Javax.resource.cci.Record, Javax.resource.cci.MappedRecord, Javax.resource.cci.IndexedRecord

Javax.resource.cci.IndexedRecord

Javax.resource.cci.ResultSet

Java.sql.ResultSetMetAdata
javax.resource.cci.connectionmetadata

Javax.resource.cci.ResourceAdapterMetaData

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.