Chapter 16. Java Connector Architecture (JCA) Management
16.1. About the Java Connector Architecture (JCA)
The Java EE Connector Architecture (JCA) defines a standard architecture for Java EE systems to external heterogeneous Enterprise Information Systems (EIS). Examples of EISs include Enterprise Resource Planning (ERP) systems, mainframe transaction processing (TP), databases, and messaging systems. A resource adapter is a component that implements the Java EE Connector API architecture.
JCA 1.7 provides features for managing:
- work instances
- transaction inflow
- message inflow
JCA 1.7 was developed under the Java Community Process as JSR-322.
16.2. About Resource Adapters
A resource adapter is a deployable Java EE component that provides communication between a Java EE application and an Enterprise Information System (EIS) using the Java Connector Architecture (JCA) specification. A resource adapter is often provided by EIS vendors to allow easy integration of their products with Java EE applications.
An Enterprise Information System can be any other software system within an organization. Examples include Enterprise Resource Planning (ERP) systems, database systems, e-mail servers and proprietary messaging systems.
A resource adapter is packaged in a Resource Adapter Archive (RAR) file which can be deployed to JBoss EAP. A RAR file may also be included in an Enterprise Archive (EAR) deployment.
16.3. Configuring the JCA Subsystem
jca subsystem controls the general settings for the JCA container and resource adapter deployments. You can configure the
jca subsystem using the management console or the management CLI.
The main JCA elements to configure are:
- Configure JCA settings from the management console
jcasubsystem can be configured from the management console by navigating to Configuration → Subsystems → JCA. Then, select the appropriate tab:
- Common Config - Contains settings for the cached connection manager, archive validation, and bean validation. Each of these is contained in their own tab as well. Modify these settings by opening the appropriate tab and clicking the Edit button.
- Bootstrap Contexts - Contains the list of configured bootstrap contexts. New bootstrap context objects can be added, removed, and configured. Each bootstrap context must be assigned a work manager.
Work Manager - Contains the list of configured work managers. New work managers can be added, removed, and their thread pools configured here. Each work manager can have one short-running thread pool and an optional long-running thread pool.
The thread pool attributes can be configured by clicking View on the selected work manager.
- Configure JCA settings from the management CLI
jcasubsystem can be configured from the management CLI from the
/subsystem=jcaaddress. In a managed domain, you must precede the command with
This determines whether archive validation will be performed on the deployment units. The following table describes the attributes you can set for archive validation.
Table 16.1. Archive Validation Attributes
Specifies whether archive validation is enabled.
Specifies whether an archive validation error report fails the deployment.
Specifies whether an archive validation warning report fails the deployment.
If an archive does not implement the JCA specification correctly and archive validation is enabled, an error message will display during deployment describing the problem. For example:
Severity: ERROR Section: 19.4.2 Description: A ResourceAdapter must implement a "public int hashCode()" method. Code: com.mycompany.myproject.ResourceAdapterImpl Severity: ERROR Section: 19.4.2 Description: A ResourceAdapter must implement a "public boolean equals(Object)" method. Code: com.mycompany.myproject.ResourceAdapterImpl
If archive validation is not specified, it is considered present and the
enabled attribute defaults to
This setting determines whether bean validation (JSR-303) will be performed on the deployment units. The following table describes the attributes you can set for bean validation.
Table 16.2. Bean Validation Attributes
Specifies whether bean validation is enabled.
If bean validation is not specified, it is considered present and the
enabled attribute defaults to
There are two types of work managers:
- Default work manager
- The default work manager and its thread pools.
- Custom work manager
- A custom work manager definition and its thread pools.
The following table describes the attributes you can set for work managers.
Table 16.3. Work Manager Attributes
Specifies the name of the work manager.
Thread pool for standard Work instances. Each work manager has one short-running thread pool.
Thread pool for JCA 1.7 Work instances that set the
The following table describes the attributes you can set for work manager thread pools.
Table 16.4. Thread Pool Attributes
Specifies the name of the thread pool.
Specifies the amount of time that pool threads should be kept after doing work.
Boolean setting that determines whether core threads may time out. The default value is false.
Reference to the thread factory.
The maximum thread pool size.
The core thread pool size. This must be equal to or smaller than the maximum thread pool size.
The maximum queue length.
This is used to define custom bootstrap contexts. The following table describes the attributes you can set for bootstrap contexts.
Table 16.5. Bootstrap Context Attributes
Specifies the name of the bootstrap context.
Specifies the name of the work manager to use for this context.
Cached Connection Manager
This is used for debugging connections and supporting lazy enlistment of a connection in a transaction, tracking whether they are used and released properly by the application. The following table describes the attributes you can set for the cached connection manager.
Table 16.6. Cached Connection Manager Attributes
Outputs warning on failure to explicitly close connections.
Throws exception on failure to explicitly close connections.
Specifies that unknown connections will not be cached.
16.4. Configuring Resource Adapters
16.4.1. Deploy a Resource Adapter
Resource adapters can be deployed just like other deployments using the management CLI or the management console. When running a standalone server, you can also copy the archive to the deployments directory to be picked up by the deployment scanner.
Deploy a Resource Adapter using the Management CLI
To deploy the resource adapter to a standalone server, enter the following management CLI command.
To deploy the resource adapter to all server groups in a managed domain, enter the following management CLI command.
deploy /path/to/resource-adapter.rar --all-server-groups
Deploy a Resource Adapter using the Management Console
- Log in to the management console and click on the Deployments tab.
- Click Add. In a managed domain, you will first need to select Content Repository.
- Choose the Upload a new deployment option and click Next.
- Browse to the resource adapter archive and click Next.
- Verify the upload, then click Finish.
- In a managed domain, assign the deployment to the appropriate server groups and enable the deployment.
Deploy a Resource Adapter Using the Deployment Scanner
To deploy a resource adapter manually to a standalone server, copy the resource adapter archive to the server deployments directory, for example,
EAP_HOME/standalone/deployments/. This will be picked up and deployed by the deployment scanner.
This option is not available for managed domains. You must use either the management console or the management CLI to deploy the resource adapter to server groups.
16.4.2. Configure a Resource Adapter
You can configure resource adapters using the management interfaces. The below example shows how to configure a resource adapter using the management CLI. See your resource adapter vendor’s documentation for supported properties and other important information.
Add the Resource Adapter Configuration
Add the resource adapter configuration.
Configure the Resource Adapter Settings
Configure any of the following settings as necessary.
Add an admin object.
Configure an admin object configuration property.
Add a connection definition for a managed connection factory.
Configure a managed connection factory configuration property.
Configure whether to record the enlistment trace. You can disable the recording of enlistment traces by setting the
Disabling the enlistment trace will make tracking down errors during transaction enlistment more difficult.
See Resource Adapter Attributes for all available configuration options for resource adapters.
Activate the Resource Adapter
Activate the resource adapter.
You can also define capacity policies for resource adapters. For more details, see the Capacity Policies section.
16.4.3. Deploy and Configure the Websphere MQ Resource Adapter
You can find the instructions for deploying the Websphere MQ resource adapter in Configuring Messaging for JBoss EAP.
16.4.4. Deploy and Configure the Generic JMS Resource Adapter
You can find the instructions for configuring the generic JMS resource adapter in Configuring Messaging for JBoss EAP.
16.5. Configure Managed Connection Pools
JBoss EAP provides three implementations of the
- This is the default connection pool in JBoss EAP 7 and provides the best out-of-the-box performance.
- This was the default connection pool in previous JBoss EAP versions.
- This connection pool is used for debugging purposes only and will report any leaks upon shutdown or when the pool is flushed.
You can set the managed connection pool implementation for a datasource using the following management CLI command.
You can set the managed connection pool implementation for a resource adapter using the following management CLI command.
You can set the managed connection pool implementation for a messaging server using the following management CLI command.
16.6. View Connection Statistics
You can read statistics for a defined connection from the
/deployment=NAME.rar subtree. This is so that you can access statistics for any RAR, even if it not defined in a
Be sure to specify the
include-runtime=true argument, as all statistics are runtime-only information.
See Resource Adapter Statistics for information on the available statistics.