Sun Java System Application Server Platform Edition 8.2 Administration Guide

About Custom Resources

Using Custom Resources

A custom resource accesses a local JNDI repository and an external resource accesses an external JNDI repository. Both types of resources need user-specified factory class elements, JNDI name attributes, etc. In this section, we will discuss how to configure JNDI connection factory resources, for J2EE resources, and how to access these resources.

Within the Application Server, you can create, delete, and list resources, as well as list-jndi-entities.

ProcedureTo create a custom resource

  1. In the left pane of the Admin Console, open the Application Server instance for the JNDI configuration to be modified.

  2. Open the JNDI tab and click Custom Resources.

    If any custom resources have been created already, they are listed in the right pane. To create a new custom resource, click New. Open the JNDI tab and click New. A page for adding a new custom resource appears.

  3. In the JNDI Name field, enter the name to use to access the resource.

    This name will be registered in the JNDI naming service.

  4. In the Resource Type field, enter a fully qualified type definition, as shown in the example above.

    The Resource Type definition follows the format, xxx.xxx.

  5. In the Factory Class field, enter a factory class name for the custom resource to be created.

    The Factory Class is the user-specified name for the factory class. This class implements the javax.naming.spi.ObjectFactory interface.

  6. In the Description field, enter a description for the resource to be creating.

    This description is a string value and can include a maximum of 250 characters.

  7. Mark the Custom Resource Enabled checkbox, to enable the custom resource.

  8. Click OK to save your custom resource.

Equivalent asadmin command

create-custom-resource

ProcedureTo edit a custom resource

  1. In the left pane of the Admin Console, open the Application Server instance for the JNDI configuration to be modified.

  2. Open JNDI and select Custom Resources.

    If any custom resources have been created already, they are listed in the right pane.

  3. Click on the file name in the right pane.

  4. Edit the Resource Type field, the Factory Class field, or the Description field.

  5. Mark the Custom Resource Enabled checkbox, to enable the custom resource.

  6. Click Save to save the changes to the custom resource.

ProcedureTo delete a custom resource

  1. In the left pane of the Admin Console, open the JNDI tab.

  2. Click Custom Resources.

    If any custom resources have been created already, they are listed in the right pane.

  3. Click in the box next to the name of the resource to be deleted.

  4. Click Delete. The custom resource is deleted.

Equivalent asadmin command

delete-custom-resource

Listing Custom Resources

To list custom resources, type the asadmin list-custom-resources command. For example, to list custom resources on the host plum, type the following:


$asadmin list-custom-resources --host plum target6

For the full context, type asadmin help list-custom-resources.