More Books
JBoss 4.0 The Official Guide
JBoss® 4.0 The Official Guide
Table of Contents
Copyright
About the Authors
We Want to Hear from You!
Introduction
What This Book Covers
About JBoss
About Open Source
About Professional Open Source
What's New in JBoss 4.0
Chapter 1.  Installing and Building the JBoss Server
Getting the Binary Files
Installing the Binary Package
Basic Installation Testing
Booting from a Network Server
Building the Server from Source Code
Chapter 2.  The JBoss JMX Microkernel
JMX
The JBoss JMX Implementation Architecture
Connecting to the JMX Server
Using JMX as a Microkernel
The JBoss Deployer Architecture
Exposing MBean Events via SNMP
Remote Access to Services, Detached Invokers
Chapter 3.  Naming on JBoss
An Overview of JNDI
The JBossNS Architecture
Chapter 4.  Transactions on JBoss
Transaction and JTA Overview
JBoss Transaction Internals
Chapter 5.  EJBs on JBoss
The EJB Client-Side View
The EJB Server-Side View
The EJB Container
Entity Bean Locking and Deadlock Detection
Chapter 6.  Messaging on JBoss
JMS Examples
JBossMQ Overview
JBossMQ Configuration and MBeans
Specifying the MDB JMS Provider
Chapter 7.  Connectors on JBoss
JCA Overview
An Overview of the JBossCX Architecture
Configuring JDBC Datasources
Configuring Generic JCA Adaptors
Chapter 8.  Security on JBoss
J2EE Declarative Security Overview
An Introduction to JAAS
The JBoss Security Model
The JBossSX Architecture
The Secure Remote Password (SRP) Protocol
Running JBoss with a Java 2 Security Manager
Using SSL with JBoss and JSSE
Configuring JBoss for Use Behind a Firewall
Securing the JBoss Server
Chapter 9.  Web Applications
The Tomcat Service
The Tomcat server.xml File
The Engine Element
The Host Element
Using SSL with the JBoss/Tomcat Bundle
Setting the Context Root of a Web Application
Setting Up Virtual Hosts
Serving Static Content
Using Apache with Tomcat
Using Clustering
Integrating Third-Party Servlet Containers
Chapter 10.  MBean Services Miscellany
System Properties Management
Property Editor Management
Services Binding Management
Scheduling Tasks
The Log4j Service MBean
RMI Dynamic Class Loading
Chapter 11.  The CMP Engine
Example Code
The jbosscmp-jdbc Structure
Entity Beans
CMP Fields
Container-Managed Relationships
Declaring Queries
Optimized Loading
The Loading Process
Transactions
Optimistic Locking
Entity Commands and Primary Key Generation
JBoss Global Defaults
Datasource Customization
Chapter 12.  Web Services
JAX-RPC Service Endpoints
Enterprise JavaBean Endpoints
Web Services ClientsA JAX-RPC Client
Service References
Chapter 13.  Hibernate
The Hibernate MBean
Hibernate Archives
Using Hibernate Objects
Using a HAR File Inside an EAR File
The HAR Deployer
Chapter 14.  Aspect-Oriented Programming (AOP) Support
JBoss AOP: EJB-Style Services for Plain Java Objects
Why AOP?
Basic Concepts of AOP
Building JBoss AOP Applications
The JBoss AOP Deployer
Packaging and Deploying AOP Applications to JBoss
Appendix A.  The GNU Lesser General Public License (LGPL)
GNU General Public License
Appendix B.  Example Installation
Index
SYMBOL
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X

JCA Overview

J2EE 1.4 contains a connector architecture specification called JCA that allows for the integration of transacted and secure resource adaptors into a J2EE application server environment. The JCA specification describes the notion of such resource managers as enterprise information systems (EISs). Examples of EISs include enterprise resource planning packages, mainframe transaction processing, and non-Java legacy applications.

The reason for focusing on EIS is primarily because the notions of transactions, security, and scalability are requirements in enterprise software systems. However, the JCA is applicable to any resource that needs to integrate into JBoss in a secure, scalable, and transacted manner. This section focuses on resource adapters as a generic notion rather than something specific to the EIS environment.

The JCA defines a standard service provider interface (SPI) for integrating the transaction, security, and connection-management facilities of an application server with those of a resource manager. The SPI defines the system-level contract between the resource adaptor and the application server.

The JCA also defines a common client interface (CCI) for accessing resources. The CCI is targeted at EIS development tools and other sophisticated users of integrated resources. The CCI provides a way to minimize the EIS-specific code required by such tools. Typically, J2EE developers access a resource by using such a tool or a resource-specific interface rather than using CCI directly. The reason is that the CCI is not a type-specific API. To be used effectively, CCI must be used in conjunction with metadata that describes how to map from the generic CCI API to the resource manager-specific data types used internally by the resource manager.

The purpose of the JCA is to enable a resource vendor to provide a standard adaptor for its product. A resource adaptor is a system-level software driver that a Java application uses to connect to a resource. The resource adaptor plugs into an application server and provides connectivity between the resource manager, the application server, and the enterprise application. A resource vendor need only implement a JCA-compliant adaptor once to allow use of the resource manager in any JCA-capable application server.

An application server vendor extends its architecture once to support the JCA and is then assured of seamless connectivity to multiple resource managers. Likewise, a resource manager vendor provides one standard resource adaptor, and it has the capability to plug in to any application server that supports the JCA.

Figure 7.1 illustrates that the application server is extended to provide support for the JCA SPI to allow a resource adaptor to integrate with the server connection pooling, transaction management, and security management facilities. This integration API defines a three-part system contract:

  • Connection management This contract allows the application server to pool resource connections. The purpose of this pool management is to allow for scalability. Resource connections are typically expense objects to create, and pooling them allows for more effective reuse and management.

  • Transaction management This contract allows the application server transaction manager to manage transactions that engage resource managers.

  • Security management This contract enables secured access to resource managers.

Figure 7.1. The relationship between a J2EE application server and a JCA resource adaptor.


The resource adaptor implements the resource manager side of the system contract. This entails using the application server connection pooling, providing transaction resource information, and using the security integration information. The resource adaptor also exposes the resource manager to the application server components. This can be done using the CCI and/or a resource adaptor-specific API.

The application component integrates into the application server by using a standard J2EE container-to-component contract. For an EJB component, this contract is defined by the EJB specification. The application component interacts with the resource adaptor in the same way it would with any other standard resource factory, such as a javax.sql.DataSource JDBC resource factory. The only difference with a JCA resource adaptor is that the client has the option of using the resource adaptor-independent CCI API if the resource adaptor supports this.

Figure 7.2 (from the JCA 1.5 specification) illustrates the relationship between the JCA architecture participants in terms of how they relate to the JCA SPI, CCI, and JTA packages.

Figure 7.2. The JCA 1.5 specification class diagram for the connection management architecture.


The JBossCX architecture provides the implementation of the application server-specific classes. Figure 7.2 shows that this comes down to the implementation of the javax.resource.spi.ConnectionManager and javax.resource.spi.ConnectionEventListener interfaces. The key aspects of this implementation are discussed in the following section.