What are J2EE Connectors?

Years ago, when an application needed to talk to a database, it had to open a socket, connect to the database server, and communicate according to some proprietary protocol. All of this connection code polluted the business logic and limited the database portability. Fortunately, Java Database Connectivity (JDBC) now allows you to use a common API to access a great variety of databases. Under the covers, JDBC drivers (or "resource adapters") translate the JDBC calls into database-specific commands.

J2EE Connectors are resource adapters that let you communicate generically with all sorts of external systems, not just databases. Each Connector obeys some application-level client API (like JDBC) and translates those calls to protocols understood by the remote system. The Connector also implements system-level interfaces that let the J2EE container manage connection pooling, transactions, and security. In the end, instead of worrying about how to connect to a remote system, the EJBs and Servlets can just look up a generic connection factory, get a connection, and interact with the system through the client API, as shown in Figure 12-1.

image from book
Figure 12-1: J2EE Connector Architecture

The following terms are commonly used when talking about J2EE Connectors:

  • Resource adapter. A resource adapter is a common term used to describe a single Connector. Essentially, it's a system-level software driver that the application server or application client can use to connect to an Enterprise Information Systems (EIS) tier . A resource adapter is usually packaged into a resource adapter archive (RAR) file using the Java archive (JAR) format.

  • Client API. The programming interface that business components use to interact with a Connector. Several Connectors may be implemented that share the same application API. These Connectors allow developers to write portable application code that will work with all of them.

  • System contract. A collection of interfaces defined by the Java Connector Architecture (JCA) specification and implemented by each Connector. The container uses these interfaces to interact with the Connector genericallyinitializing transactions, obtaining connections, and so on.

  • Enterprise information system (EIS). A common term used to describe an external system (for example, SAP, PeopleSoft, a legacy mainframe).



Oracle Application Server 10g. J2EE Deployment and Administration
Oracle Application Server 10g: J2EE Deployment and Administration
ISBN: 1590592352
EAN: 2147483647
Year: 2004
Pages: 150

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