Chapter 5. External Resources

Table of Contents

5.1. Resource Types
5.2. Resource Configuration
5.2.1. Configuring a Data Source
5.2.2. Configuring a Mail Source
5.2.3. Configuring a URL Source
5.2.4. Configuring a Custom Resource
5.2.5. Configuring an External Resource (JMS)
5.2.6. External Resource Configuration (Tmax)

This chapter describes a variety of external resources that can be used to build a system by integrating with JEUS, and how to configure them. Refer to each external resource guide for more information about configuring external resources and their usage.

External resources exist outside JEUS, and applications can access them through JEUS. A typical example is a database. Resources like these can be accessed by adding related configurations to JEUS.

Note

If an external resource provides a resource adapter with JCA standard compatibility, it is recommended to deploy and use the provided resource adapter.

The following are the resources that can be configured in JEUS.

This section describes how to configure each resource in WebAdmin.

Resources are configured within the scope of the domain and registered on a server when the server starts.

Select [Resources] from the left menu of WebAdmin to view each resource and register it on the server, as well as modify or delete it.


Custom resources enable the lookup and use of Java bean resources through JNDI ObjectFactory. This section describes how to configure and register custom resources.

The following is an example of an object factory class that creates a Java bean resource class and resource instance. This class must be exist in the 'SERVER_HOME/lib/application' or 'DOMAIN_HOME/lib/application' directory.



Note

To dynamically add a custom resource, the applicable classes must exist in the class path of the server class loader. If the class loader cannot load the classes, then the add command, which is normally executed dynamically, is processed as pending. In this case, add the custom resource classes to the 'SERVER_HOME/lib/application' or 'DOMAIN_HOME/lib/application' folder and restart the server.

Deleting a custom resource is not performed gracefully. In other words, even if there is a request in progress, the system does not wait until the request is complete which may cause errors to occur in the user applications.

Using WebAdmin

The following screenshots show how to dynamically register a custom resource in WebAdmin.

Using the Console Tool

A custom resource can be looked up and dynamically added or deleted using the console tool.

[Example 5.3] Looking up, Adding, and Deleting Custom Resources in the Console Tool

[DAS]domain1.adminServer>add-custom-resource custom/dog -resource dog.Dog -factory dog.DogFactory
Successfully performed the ADD operation for A custom resource.
Check the results using "list-custom-resources or add-custom-resource"

[DAS]domain1.adminServer>list-custom-resources
List of Custom Resources
================================================================================
+-------------+--------------------+--------------------------+----------------+
| Export Name |   Resource Class   |       Factory Class      |   Properties   |
+-------------+--------------------+--------------------------+----------------+
| custom/dog  | dog.Dog            | dog.DogFactory           | [test=1,       |
|             |                    |                          |test1=2]        |
+-------------+--------------------+--------------------------+----------------+
================================================================================

[DAS]domain1.adminServer>add-custom-resource-to-servers custom/dog -servers server1
Successfully performed the ADD operation for A custom resource.
Check the results using "list-custom-resources"

[DAS]domain1.adminServer>remove-custom-resource custom/dog
Successfully performed the REMOVE operation for A custom resource.
Check the results using "list-custom-resources or remove-custom-resource"

[DAS]domain1.adminServer>list-custom-resources
List of Custom Resources
================================================================================
+-------------+--------------------+--------------------------+----------------+
| Export Name |   Resource Class   |       Factory Class      |   Properties   |
+-------------+--------------------+--------------------------+----------------+
(No data available)
================================================================================

External resources are largely divided into JMS source and Connector.

Select [Resources] > [External Source] from the left menu of WebAdmin to go to the external resource list to enter the configurations.


JMS Source

JMS sources that are configured in the domain can be looked up, added, modified, or deleted in WebAdmin.

To add a JMS source, click [Add] at the top of JMS Source in the External Resource list screen.

The following describes the JMS source configuration.


The following describes the configuration items.

ItemDescription
Vendor

JMS vendor. Select one of:

  • ibmmq: IBM product.

  • sonicmq: Sonic MQ.

  • others: other product.

Factory Class NameFactory class name of the JMS resource.
Resource Type

JMS type.

Select one of:

  • QCF

  • TCF

  • Q

  • T

  • XAQCF

  • XATCF

  • LOCALXAQCF

  • LOCALXATCF

Export NameName to bind to JNDI. Can be used to obtain JMS ConnectionFactory and Destination.
QueueUse only when the resource type is Q.
QueueManagerUse only when the resource type is Q.
TopicUse only when the resource type is T.
PropertyNecessary attributes for JMS resources. It has a name, a type, and a value.

Note

Refer to the IBM MQ or the Sonic MQ manual for more information about each item.

Adding a Connector

A connector that is configured in the domain can be looked up, added, changed, or deleted in WebAdmin. Refer to "JEUS JCA guide" for more information about connectors.

External resources can be configured so that JEUS can integrate with Tmax or Infinite Cache. For integration with Tmax, JEUS connects to Tmax to configure WebT and JTmax. WebT is an outbound service that uses Tmax transaction services, and JTmax is an inbound service that receives requests from Tmax. Refer to the JTmax Server Guide of the Tmax manual for more information.

This section describes how to implement and register the external resources.

The following is the jeus.external.ResourceBootstrapper interface. The class that implements this interface must reside in the 'SERVER_HOME/lib/application' or 'DOMAIN_HOME/lib/application' directory.


Note

To dynamically add an external resource, the applicable classes must exist in the class path of the server class loader. If the class loader cannot load the classes, then the add command, which is normally executed dynamically, is processed as pending. In this case, add the external resource classes to the 'SERVER_HOME/lib/application' or 'DOMAIN_HOME/lib/application' folder and restart the server.

Deleting an external resource is not performed gracefully. This means that an incomplete request may cause errors to occur in the user applications.

Using WebAdmin

The following shows how to dynamically register an external resource using WebAdmin.

Using the Console Tool

An external resource can be looked up and dynamically added or deleted by using the console tool.

[Example 5.5] Viewing, Adding, and Deleting an External Resource in the Console Tool

[DAS]domain1.adminServer>add-external-resource test/ext -resource test.ext.TestResourceBootstrapper  
Successfully performed the ADD operation for A external resource.
Check the results using "list-external-resources or add-external-resource"

[DAS]domain1.adminServer>list-external-resources
List of External Resources
================================================================================
+-------------+---------------------------------------------------+------------+
| Export Name |                   Resource Class                  | Properties |
+-------------+---------------------------------------------------+------------+
| test/ext    | test.ext.TestResourceBootstrapper                 | []         |
+-------------+---------------------------------------------------+------------+
================================================================================

[DAS]domain1.adminServer>add-external-resource-to-servers test/ext -servers server1
Successfully performed the ADD operation for A external resource.
Check the results using "list-external-resources"

[DAS]domain1.adminServer>remove-external-resource test/ext 
Successfully performed the REMOVE operation for A external resource.
Check the results using "list-external-resources or remove-external-resource"

[DAS]domain1.adminServer>list-external-resources
List of External Resources
================================================================================
+-------------+---------------------------------------------------+------------+
| Export Name |                   Resource Class                  | Properties |
+-------------+---------------------------------------------------+------------+
(No data available)
================================================================================