Resource Adapter

This chapter describes JEUS’s security management function, and explains how to add the jeus-connector-dd.xml file to a resource adapter, and what you need to know for deployment.

For information about packaging a resource adapter, refer to the section "21. Packaging Requirements" of the JCA standard 2.0.

1. Security Management

This section describes JEUS’s features provided for authentication and authority check of resource adapter.

1.1. Connection Authentication

As stated in the JCA standard, based on the description in ejb-jar.xml and web.xml files, you can determine who is going to authenticate a connection.

<resource-ref>
    <res-ref-name>jca/pool</res-ref-name>
    <res-type>jakarta.resource.cci.ConnectionFactory</res-type>
    <res-sharing-scope>Unshareable</res-sharing-scope>
    <res-auth>Container</res-auth>
</resource-ref>
  • <res-auth>

    Specifies either a container or application to determine which one will authenticate each application components. (Default value: container)

    Setting Value Description

    Container

    Authenticates the connection. If <res-auth> element is set to 'container,' specify a username and password in the jeus-connector-dd.xml file. An encrypted value can be used for the password.

    See the following example.

    {DES}FQrLbQ/D8O1lDVS71L28rw==

    A specified username and password are used as the authentication information that will be passed to a resource adapter when creating a connection. If a user does not specify such information in the jeus-connector-dd.xml file, the javax.security.auth.Subject object containing no contents will be passed to the resource adapter.

    For more information on password encryption, see Security Management in JEUS Domain Guide.

    Application

    If <res-auth> value is set to 'Application', JEUS will not be involved in authenticating the connection when requested by an application. Instead, the application will exchange authentication information with the resource adapter. Such information normally uses the resource adapter class that implements the jakarta.resource.spi.ConnectionRequestInfo interface.

2. Packaging

To deploy a resource adapter to JEUS, a jeus-connector-dd.xml file should be created as a DD (Deployment Descriptor) in addition to the ra.xml file.

In the file, you should specify the following:

After configuring these items, locate the jeus-connector-dd.xml file in the META-INF directory of the rar file.

xxx.rar/META-INF

3. Deploy

A resource adapter can be deployed as either of the following two modules.

  • Stand-alone module: Can be used by all applications in JEUS.

  • Module included in Jakarta EE application (EAR): Can be used only within EAR.

    For more information on how to deploy applications in JEUS, JEUS Applications & Deployment Guide

3.1. Class Loading in SHARED Mode

Since a resource adapter, according to the JCA standard, deployed as a stand-alone module can be used by all applications, JEUS supports class loading in the SHARED mode. Thus, a resource adapter is always deployed in the SHARED mode regardless of the user settings.

  1. For details on the class loading method in SHARED mode, refer to Class Loader Structure in JEUS Server Guide.

  2. For details on how to deploy, JEUS Applications & Deployment Guide

3.2. Redeploy

A resource adapter can be registered with JEUS as a type of JDBC driver. The JDBC driver is registered as a class path of the server when the jar file is saved in the JEUS_HOME/lib/datasource directory. In this case, since changes are not applied when the jar file is updated, you need to restart JEUS.

On the other hand, since a resource adapter is an application managed by JEUS, its version can be updated and redeployed without restarting JEUS.

Redeployment has the following limitations.

  • To redeploy a resource adapter module, all applications using the resource adapter should also be redeployed.

    Applications that have already used the resource adapter do not need to look up the classes of the redeployed resource adapter as the classes have been cached.

  • In JEUS, when EJB modules deployed in the SHARED mode are redeployed, web modules that use the EJB modules are also automatically redeployed. However, resource adapter modules cannot be redeployed automatically, and so they need to be redeployed manually.

4. Registering Resource Adapters as Resources

A resource adapter module is considered as a driver shared and used by all the applications rather than as an independent application. In the same context, JEUS enables a resource adapter module to be registered with a domain as a connector resource.

The configuration information for the resource adapter registered in the domain is identical to the configuration information defined in the jeus-connector-dd.xml file for the resource adapter module. In this context, the resource adapter functions solely in its primary role as a module.