Sun GlassFish Enterprise Server v3 Administration Guide

Administering Custom JNDI Resources

A custom resource specifies a custom server-wide resource object factory that implements the javax.naming.spi.ObjectFactory interface. The following topics are addressed here:

ProcedureTo Create a Custom JNDI Resource

Use the create-custom-resource subcommand in remote mode to create a custom resource.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Create a custom resource by using the create-custom-resource(1) subcommand.

    Information on properties for the subcommand is contained in this help page.

  3. Restart Enterprise Server.

    See To Restart a Domain.


Example 20–1 Creating a Custom Resource

This example creates a custom resource named sample-custom-resource.


asadmin> create-custom-resource --restype topic --factoryclass com.imq.topic 
sample_custom_resource
Command create-custom-resource executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help create-custom-resource at the command line.

ProcedureTo List Custom JNDI Resources

Use the list-custom-resources subcommand in remote mode to list the existing custom resources.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. List the custom resources by using the list-custom-resources(1) subcommand.


Example 20–2 Listing Custom Resources

This example lists the existing custom resources.


asadmin> list-custom-resources
sample_custom_resource01 
sample_custom_resource02 
Command list-custom-resources executed successfully

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help list-custom-resources at the command line.

ProcedureTo Update a Custom JNDI Resource

  1. List the custom resources by using the list-custom-resources(1) subcommand.

  2. Use the set(1) subcommand to modify a custom JNDI resource.


Example 20–3 Updating a Custom JNDI Resource

This example modifies a custom resource.


asadmin> set server.resources.custom-resource.custom
/my-custom-resource.property.value=2010server.resources.custom-resource.custom
/my-custom-resource.property.value=2010

ProcedureTo Delete a Custom JNDI Resource

Use the delete-custom-resource subcommand in remote mode to delete a custom resource.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. List the custom resources by using the list-custom-resources(1) subcommand.

  3. Delete a custom resource by using the delete-custom-resource(1) subcommand.


Example 20–4 Deleting a Custom Resource

This example deletes a custom resource named sample-custom-resource.


asadmin> delete-custom-resource sample_custom_resource
Command delete-custom-resource executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help delete-custom-resource at the command line.