SKIP THE SHIPPING
Use code NOSHIP during checkout to save 40% on eligible eBooks, now through January 5. Shop now.
Register your product to gain access to bonus material or receive a coupon.
For enterprises seeking to streamline their own processes -- or integrate with partners and suppliers -- the #1 challenge is enterprise application integration (EIA). Sun's new Connector Architecture gives Java developers powerful new tools for simplifying EIA. In this definitive book, the creators of the Connector Architecture explain it in detail -- and demonstrate how to make the most of it. The authors introduce the fundamentals of application integration and the J2EE Connector architecture, including the system contracts it defines for connections, transactions, and security. Next, they present in-depth coverage of J2EE resource adapters from the application developer's perspective. Coverage includes: new connection pooling mechanisms; effective use of the J2EE platform's transactional support; techniques for leveraging J2EE security in application integration projects; and much more. The book shows how to use XML data within the J2EE and Connector framework; and concludes by walking through the construction of a working resource adapter, with extensive code examples. Appendices provide a detailed API reference and glossary.
Managing Connections with J2EE Connector Architecture
Click below for Sample Chapter related to this title:
sharmach03.pdf
(NOTE: Each chapter ends with a Conclusion.)
Preface.
Acknowledgments.
1. Enterprise Application Integration.
What Is Enterprise Application Integration?
Web-driven Application Integration.
Enterprise Information Systems.
Challenges in EIS Integration.
Enterprise Application Integration Approaches.
Two-Tier Client-Server Approach.
Using Synchronous Adapters
Using Asynchronous Adapters.
Queue-Based Approach.
Publish-Subscribe Approach.
Application Server-Based Integration.
J2EE Connector Architecture and EAI.
What Is the J2EE Platform?
Components and Containers.
J2EE Technologies.
J2EE Connector Architecture Overview.
Connector Architecture Contracts.
System-Level Contracts.
Application Contract.
Packaging and Deployment.
Why Use the Connector Architecture?
Example Scenario.
Application Requirements.
Example Architecture.
Connection Management Contract.
Connection Management Architecture.
Application Programming Model.
Introduction to Transactions.
Characteristics of Transactions.
Commit Protocols.
Key Issues with Transactions.
Developing Transactional Applications.
Using the J2EE Platform.
Using Enterprise Beans.
Using JTA Transactions.
Compensating Transactions.
Transaction Levels.
Sample Application Transaction Scenario.
Security Concepts.
Authentication.
Authorization.
Security Definitions.
Security Model for EIS Connections.
Container-Manages Sign-On.
Component-Manages Sign-On.
Understanding EIS Sign On.
Setting a Resource Principal.
Authenticating a Resource Principal.
Authorizing a Resource Principal.
Establishing a Secure Communication.
Managing Security.
Role of the Application Component Provider.
Role of the Deployer.
Role of the Application Server Vendor.
Other Roles.
Security Example.
Security Environment.
Example Deployment.
Synchronous Communication.
Issues to Consider.
Dependency on Specific Middleware Mechanisms.
Dependency Between EIS and Application.
Asynchronous Communication.
Connector Architecture 2.0 Message Handling.
Asynchronous Inbound Communication.
Asynchronous Outbound Communication.
Synchronous Inbound Communication.
JMS-based Communication.
Communication Trade-offs.
Enterprise Messaging Technologies.
Java Message Service.
JMS Overview.
JMS Interfaces.
JMS and EAI.
J2EE Platform and EAI.
Messaga-driven Bean.
Example.
Overview of the CCI.
CCI Programming Example.
Connection Interfaces.
ConnectionFactory Interface.
ConnectionSpec Interface.
Connection Interface.
LocalTransaction Interface.
Interaction Interfaces.
Interaction Interface.
InteractionSpec Interface.
Data Representation Interfaces.
Metadata Interfaces.
Exception Interfaces.
Code Examples.
Obtaining a Connection.
Using an InteractionSpec Object.
Using a Generic Record.
Using a ResultSet.
Using a Custom Record.
Types of Tools.
Connector Architecture Tools Support.
EIS Access Objects.
Command Bean.
Record.
Data Access Object.
Guidelines for Access Objects.
EJB 2.0 Container-Managed Persistence.
Enterprise Application Integration and XML.
Overview of XML Concepts.
Defining Document Types and Formats.
Java Technologies Supporting XML.
Java API for XML Processing (JAXP).
Java Architecture for XML Binding (JAXB)
Simple API for XML Messaging (JAXM).
Java API for XML-based RPC (JAX-RPC).
Java API for XML Registries (JAXR).
XML and Connector Architecture.
XML and Connector Scenario.
Example Application Processing.
XML Support in Connector Architecture.
Implementing a Resource Adapter.
Client API.
Transaction Support Level.
Authentication Mechanism.
Reauthentication Support.
System Contract Interfaces.
Implementing Connection Management.
Connection Factory.
Managed Connection Factory.
Connection Manager.
ManagedConnection.
Connection Handle.
Managing Transactions.
Using Local Transactions.
Handling XAResource Transactions.
Implementing Security Management.
Container Managed Sign-on.
Application Managed Sign-on.
Using the ConnectionRequestInfo Interface.
Handling Connection Events.
Distributing a Resource Adapter.
Packaging a Resource Adapter.
Resource Adapter Deployment Descriptor.
Using an Adapter in the Runtime Environment.
Deployment Approaches.
Standalone Deployment.
Bundled Deployment.
Packaging a Resource Adapter.
Deployment and Configuration.
Connection Factory Creation.
Using Packaging and Deployment Tools.
Connection Management Contract.
Contract Overview.
Scenarios.
Creating New Connections.
Matching Existing Connections.
Handling Connection Events.
Non-Mangaed Environment.
Connection Management Classes and Interfaces.
ConnectionFactory and Connection Interfaces.
Connection Management Contract.
Support for Error Handling.
Transaction Management Contract.
Local Transaction Management.
example Local Transaction.
Local Transaction Management Contract Interfaces.
XAResource Transaction Management.
XAResource Interface.
Java Transaction API (JTA).
Two-Phase Commit Protocol.
Requirements for Transaction Management Contract.
Connection Sharing.
Connection Sharing and Local Transactions.
Transaction Scenarios.
Transaction Setup.
Transaction Cleanup.
Interfaces and Classes.
Subject Class.
Principle Interface.
PasswordCredential.
GenericCredential Interface.
ManagedConnectionFactory Interface.
Security Management Contract.
Resource Adapter to Application Server Contract.
Application Server to Resource Adapter Contract.
Connector Architecture 2.0.
Asynchronous Resource Adapter Support.
Java Message Service Provider Pluggability.
XML Support in Common Client Interface.
Common Client Interface Metadata Support.
J2EE and EAI.
Architecture of SAP Systems.
SAP's Remote Function Call.
The Java Connector (JCO).
Architecture of the SAP Connector.
Connection Management of the SAP Connector.
Transaction Management of the SAP Connector.
Security Management of the SAP Connector.
The Common Client Interface of the SAP Connector.
Example.
Package and Class Declaration.
Member Variables.
Getting the Bank List.
Creating a New Bank.
Enterprise Access Builder (EAB) 101.
JCA Application Development Process.
Overview of the Application.
Using the EAB Session Bean Tool.
Using the Session Bean Editor.
Testing the Application in the WebSphere Test Environment.
Moving Your Application to the WebSphere Application Server.
Deploying the RAR File.
Specifying the Connection Pooling Properties.
Assembling and Deploying the Application onto the WebSphere Application Server.
Using the Deployed Application.
Future Directions.
References.
WebLogic Server's Implementation of the J2EE Connector Architecture Specification.
WebLogic Server Supplementary Deployment Descriptor.
Extended Connection Pool Services.
Example weblogic-ra.xml Deployment Descriptor.
Deployment Descriptor Editor.
Monitoring a Resource Adapter in the WebLogic Server Environment.
WebLogic Integration 2.0.
Application Views.
Adapter Development Kit (ADK).
BEA Partners Adopting the J2EE Connector Architecture.
References.
This book provides an in-depth coverage of the Java 2, Enterprise Edition (J2EE) platform Connector architecture. The Connector architecture is an integral part of the J2EE platform, and, as a key component in the platform's support for application integration, it ensures that J2EE applications can connect to and use a multitude of EISs and legacy systems. The Connector architecture, because it defines a standard set of contracts for handling connections, transactions, and security, makes it easier for vendors to develop products that can hook into the J2EE platform. Vendors follow the guidelines of these Connector contracts to develop special software modules, called resource adapters, that enable this linkage between their underlying products and the J2EE platform.
This book is written for application component developers who are building applications that run on the J2EE platform. It is also of interest to independent software vendors (ISVs) and others who develop resource adapters for specific EISs, such as legacy and database systems.
This book uses certain graphical conventions.
The graphical conventions used here are based on the Unified Modeling Language (UML) standard. UML is a modeling language for object-oriented development. In general, object-oriented modeling decomposes systems into collaborating objects. The resulting model captures the underlying semantics of a problem. UML defines different models for representing systems, and graphical diagrams to depict these models, including a class model, a state model, a use case model, an interaction model, an implementation model, and a deployment model.
We only use a subset of the UML diagrams in this book. The diagrams of most interest to readers are the class diagrams, which depict static structure, and sequence, object, and collaboration diagrams, which depict dynamic object interactions.
Note that we use the terms application server, server, and J2EE application server interchangeably. Unless otherwise noted, these three terms all refer to a J2EE application server.
For those interested in more information about UML, we refer you to the following sources:
You should refer to other publications related to J2EE and to the J2EE Web site, http://java.sun.com/j2ee/. The following books, both online and in print, are of particular interest to those developing J2EE Connectors and other application components.
As noted previously, we've written this book for two distinct audiences: application developers and software product vendors (including ISVs) who are building resource adapters and enterprise information systems. Application developers work within the Information Technology (IT) department of an enterprise. Their charter is to link the underlying infrastructure products, whether they were developed in-house or purchased from a third-party vendor, with the J2EE application server and platform technologies. Application developers need to know how to use the resource adapters provided by the product vendors and ISVs, and vendors need to know how to construct resource adapters that conform to the Connector architecture specifications.
We have organized this book into sections so that it is easier for readers to access the information they need. Before we get into the specifics of using or building resource adapters, we have included an introductory section that provides background information of interest to all readers. This first section, consisting of Chapters 1 and 2, provides a general introduction to application integration and the J2EE Connector architecture.
The next section is primarily for application developers who need to know how to use a resource adapter. This section describes the Connector application programming model. Chapters 3 through 9 describe how to use a resource adapter from an application developer perspective.
Chapters 10 through 12 focus on the details of the Connector system contracts. These chapters are written for product vendors and ISVs interested in building a resource adapter. Product vendors and ISVs will probably want to focus on Chapter 10 and Chapter 11, which provide the details for building and deploying a resource adapter.
The book begins with an introduction to enterprise application integration, a term that is often abbreviated to EAI. Chapter 1, Enterprise Application Integration, describes the state of enterprise application integration today and shows how it has evolved to this point. Much of the J2EE Connector architecture addresses the problem of application integration, particularly Web-driven application integration. Because more and more services are provided through the Web, it is essential that enterprises have an efficient solution for EAI.
Enterprises must also integrate their enterprise information systems (EISs) with their Web services. EISs encompass the information infrastructure--the business processes and data--of an enterprise. Often, these are the legacy applications, database management systems, and so forth, that the enterprise relies on for its business functioning. This chapter describes the different approaches to integrating the often disparate pieces of an enterprise's information infrastructure, and it shows how the J2EE Connector architecture helps with this process.
Chapter 2, J2EE Connector Architecture Overview, provides an introduction to the Connector architecture. It presents the architecture's concepts and introduces the three system contracts defined by the architecture: the connection, transaction, and security contracts. The Connector architecture is designed for applications running on the J2EE platform. For those not quite as familiar with the J2EE platform, this chapter also includes a description of the platform's components and technologies.
Chapter 3, Managing Connections, starts the application programming model section. This chapter focuses on how application developers can best use the connection pooling mechanisms defined by the Connector architecture's connection management contract. The chapter describes the interfaces that support connection pooling and shows application developers how to use these interfaces so that their applications can connect to an EIS.
Application developers also need to know how to effectively use the transactional support provided by the J2EE platform, and specifically by the Connector architecture. The architecture supports both local and global transactions, and developers use different application programming interfaces to implement these approaches. Chapter 4, Working with Transactions, describes basic transactional concepts and illustrates how to develop transactional applications on the J2EE platform.
Security is also important for EAI. Chapter 5, Managing Security, describes the support for secure connections to EISs that the Connector architecture provides. The Connector architecture builds on the J2EE platform security model. The J2EE model defines the security applied to a client's access to the Web tier, and from there to the EJB tier. The Connector architecture defines a security management contract that extends the J2EE security model to include the connection between the EJB and EIS tiers. This security contract enables a J2EE server to manage security while it creates connections to an EIS and accesses EIS resources. This chapter introduces the reader to the Connector's security contract and describes the basic J2EE security concepts and terminology. It presents the security model as it relates to the process of signing on to an EIS and illustrates that process with an example scenario.
The Connector architecture supports synchronous and asynchronous messaging systems. These types of messaging systems underlie communication between an application server and an EIS. Often, asynchronous messaging is the preferred communication mode because it allows a message sender to continue processing without waiting for the message to be received and acknowledged. It offers improved performance over synchronous messaging and eliminates some of the dependencies between sender and receiver, or EIS and application. Chapter 6, Asynchronous Messaging, describes the Java Message Service (JMS), the standard Java API (application programming interface) defined for enterprise messaging systems, and shows how the Connector architecture accomplishes asynchronous messaging within this framework.
Chapter 7, Common Client Interface, describes the interfaces and methods of the Common Client Interface (CCI), which is a set of APIs between application components and EIS resource adapters. The CCI provides a common API across heterogeneous EISs, so that vendors specializing in application integration do not have to adapt their products to each individual EIS whose client API they want to support. By building their products to the CCI API, application integration product vendors have a standard way to plug in their resource adapters to different EISs. In addition to describing the interfaces and methods, the chapter provides an example that illustrates how to use the CCI.
Chapter 8, Tools and Frameworks, describes how to integrate application development tools with EIS resource adapters using the Connector architecture, particularly the Common Client Interface API. Integrating tools with resource adapters is particularly challenging because of the heterogeneous nature of EISs--they differ in their client APIs, their support for transactions and security, and in their application programming models. The Connector architecture promotes the use of tools so that development and system integration are simplified.
Chapter 9, XML and the Connector Architecture, provides overview information about XML (eXtensible Markup Language) and shows how to work with XML data within the J2EE and Connector framework. This chapter has a two-fold approach. It describes the current means for incorporating XML data, but, more important, it gives some insight into XML-related tools that are expected to be available in the near future.
ISVs, once they have a good grasp of the underlying contracts, need to know how to build a resource adapter module. A resource adapter is a system-level software driver that provides the connection to the vendor's EIS. A resource adapter implements the EIS side of the Connector system contracts, and it provides a client level API that applications can use to connect to the adapter's underlying EIS. Chapter 10, Building a Resource Adapter, describes the steps involved in building a resource adapter. It illustrates these steps with code examples for a sample resource adapter.
Chapter 11, Resource Adapter Packaging and Deployment, describes how to package and deploy a resource adapter that you have developed. Packaging and deployment are essential steps for bringing a resource adapter to market. The Connector architecture specifies a standard packaging format for a resource adapter. The deployment process installs components such as adapters into the enterprise's operational environment. By following the Connector architecture's packaging and deployment formats, you are assured that a resource adapter will work on any J2EE application server.
This completes the application programming model section of the book. From this point on, we focus on the system-level aspects of the Connector contracts. These next three chapters--one on each system contract--are meant to provide an "under the covers" view of the contracts. Although the intended audience for these chapters is application server vendors and resource adapter providers, application developers may find this information useful.
Chapter 12, Connection Management Contract, looks at the Connector architecture's connection management contract from a system-level viewpoint. It examines in detail the contract's interfaces and classes. It also explains how connections are handled in both two-tier and multi-tier environments and how a connection pool is implemented. Its focus is on managing connections in different environments so that scalability is enhanced.
Chapter 13, Transaction Management Contract, explains the system-level details of the Connector architecture's transaction management contract. It examines the methods of the local and global transaction interfaces and explains the different levels of transactional support that a J2EE application server provides. It also illustrates how the contract mandates the handling of this transactional support.
Chapter 14, Security Management Contract, similar to the previous two chapters, explains the system-level details of the Connector architecture's security management contract. Not only does it present and explain the interfaces and classes that the contract supports, it also shows how to use the contract to identify and authenticate users and determine their authorization and access control privileges.
The Connector architecture is constantly evolving and including new Java technologies. Chapter 15, Future Directions, describes the new technologies that will be included in the architecture. It particularly focuses on the features that the 2.0 version of the architecture is expected to support. These features will enhance EIS pluggability into the J2EE platform.
We have also included three chapters from three different resource adapter vendors. Chapter 16, written by engineers working with SAP, describes the architecture of the SAP connector, and shows how the connector manages connections, transactions, and security. It also describes the CCI provided for the SAP connector and uses an example to illustrate how to use this resource adapter in an application. Chapter 17, written by IBM Corporation, describes how developers can use the IBM J2EE Connector architecture-based tools to develop enterprise applications. This chapter focuses on using VisualAge for Java to develop an application that uses a CICS ECI connector to execute a CICS transaction within a WebSphere Application Server environment. Chapter 18, provided by BEA Systems, Inc., describes how they have implemented the J2EE Connector architecture specification in their WebLogic Server product.
Last, the book includes an appendix that contains the API reference and a glossary of terms. The reference section contains all the classes and interfaces defined by the Connector architecture as well as the methods within each interface or class.