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:
Use the create-custom-resource subcommand in remote mode to create a custom resource.
Ensure that the server is running.
Remote subcommands require a running server.
Create a custom resource by using the create-custom-resource(1) subcommand.
Information on properties for the subcommand is contained in this help page.
Restart GlassFish Server.
See To Restart a Domain.
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. |
You can also view the full syntax and options of the subcommand by typing asadmin help create-custom-resource at the command line.
Use the list-custom-resources subcommand in remote mode to list the existing custom resources.
Ensure that the server is running.
Remote subcommands require a running server.
List the custom resources by using the list-custom-resources(1) subcommand.
This example lists the existing custom resources.
asadmin> list-custom-resources sample_custom_resource01 sample_custom_resource02 Command list-custom-resources executed successfully |
You can also view the full syntax and options of the subcommand by typing asadmin help list-custom-resources at the command line.
List the custom resources by using the list-custom-resources(1) subcommand.
Use the set(1) subcommand to modify 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 |
Use the delete-custom-resource subcommand in remote mode to delete a custom resource.
Ensure that the server is running.
Remote subcommands require a running server.
List the custom resources by using the list-custom-resources(1) subcommand.
Delete a custom resource by using the delete-custom-resource(1) subcommand.
This example deletes a custom resource named sample-custom-resource.
asadmin> delete-custom-resource sample_custom_resource Command delete-custom-resource executed successfully. |
You can also view the full syntax and options of the subcommand by typing asadmin help delete-custom-resource at the command line.