Hitachi

Hitachi Application Server V10 Command Reference Guide (For UNIX® Systems)


2.18.1 create-custom-resource

Creates a custom resource.

Synopsis

asadmin [asadmin-options] create-custom-resource [--help]
    --restype type --factoryclass classname
    [--enabled={true|false}] [--description text]
    jndi-name [--target target]

Storage location

Application Server installation directory/javaee/glassfish/bin

Function

The create-custom-resource subcommand creates a custom resource. A custom resource specifies a custom server-wide resource object factory that implements the javax.naming.spi.ObjectFactory interface.

This command is supported in remote mode only.

Restart Java EE Server after creating the custom resource.

Precondition

Arguments

--help | -?

Displays the help text for the subcommand.

--target target

Specifies the availability of the target on which the custom resource is being created.

The resource is always created for the domain as a whole, but the resource-ref for the resource is only created for the specified --target. This means that although the resource is defined at the domain level, it is only available at the specified target level. Use the create-resource-ref subcommand to refer to the resource in multiple targets if needed.

Type: String

The following values can be specified:

  • server

    The resource will be available on the default server instance and on all domains hosted on the instance. This is the default value.

  • domain

    The resource will be available on the specified domain only.

  • cluster_name

    The resource will be available on every server instance in the cluster.

  • instance_name

    The resource will be available on the specified server instance only.

Default value: server

--restype type

Specifies the type of custom resource to be created.

Type: String

The following values can be specified:

  • Custom resource type

Default value: N/A

--factoryclass classname

Specifies the factory class name for the custom resource.

Type: String

The following values can be specified:

  • A class name which implements the javax.naming.spi.ObjectFactory interface.

Default value: N/A

--enabled={true|false}

Confirms whether the custom resource is enabled at runtime.

Type: Boolean

The following values can be specified:

  • true

  • false

Default value: true

--description text

Displays the text providing details about the custom resource. This description is a string value and can include a maximum of 250 characters.

Type: String

The following values can be specified:

  • Specify the description in text

Default value: N/A

jndi-name

Specifies the JNDI name of this resource.

Type: String

The following values can be specified:

  • JNDI name

Default value: N/A

Examples

The following example creates a custom resource on the server instance instance1.

asadmin create-custom-resource --target instance1 --restype topic 
--factoryclass com.imq.topic mycustomresource

Exit Status

Exit Status

Explanation

0

command executed successfully.

1

error in executing the command.