3.12.4 Setting up the JavaBeans resources

This subsection describes the settings for the JavaBeans resources.

You use the server management commands to set up the properties for the JavaBeans resources and to import the JavaBeans resources.

To set up the JavaBeans resources, use the server management commands.

This subsection describes the procedure for setting up a new JavaBeans resource, the procedure for changing the settings, and the procedure for replacing the JavaBeans resource.

Organization of this subsection
(1) Procedure for setting up a new JavaBeans resource
(2) Procedure for changing the settings of a JavaBeans resource
(3) Procedure for replacing the JavaBeans resource
(4) Content that can be specified in the definition of the JavaBeans resource properties

(1) Procedure for setting up a new JavaBeans resource

The following figure shows the procedure for setting up a new JavaBeans resource.

Figure 3-29 Procedure for setting up a new JavaBeans resource

[Figure]

A description of points 1 and 2 in the figure is as follows:

  1. Create the JavaBeans resource property file and define the JavaBeans resource properties.
    Use the template for the JavaBeans resource property file to create the JavaBeans resource property file, and then define the properties for the JavaBeans resource. The template for the JavaBeans resource property file is stored in the following directory:
    • In Windows
      Cosminexus-installation-directory\CC\admin\templates\jb_template.xml
    • In UNIX
      /opt/Cosminexus/CC/admin/templates/jb_template.xml
    For details on the content that can be specified in the definition of the JavaBeans resource properties, see (4) Content that can be specified in the definition of the JavaBeans resource properties.
  2. Use the server management commands to import the JavaBeans resource.
    Specify the path of the JavaBeans resource property file set up in point 1 and the JAR file containing the JavaBeans resource, in the argument, use the cjimportjb command, and then import the JavaBeans resource.

For details on the operations with server management commands, see 3. Basic Operations of Server Management Commands in the uCosminexus Application Server Application Setup Guide. Also, for details on the commands, see 2.4 Resource operation commands used with the J2EE server in the uCosminexus Application Server Command Reference Guide. For details on the property files, see 4.2 Property files for JavaBeans resources in the uCosminexus Application Server Application and Resource Definition Reference Guide.

Reference note
  • When you import multiple JavaBeans resources, you cannot import a JavaBeans resource with the same implementation class name as an imported JavaBeans resource. Delete the JavaBeans resource that was imported earlier, or change and re-create the implementation class name, and then import the JavaBeans resource.
    Also, if another class file is being used apart from the implementation class of the JavaBeans resource, the other class file is not checked.
  • If you use the -d option in the cjimportjb command during the import operation, the JavaBeans resources can be imported with the same directory configuration and without generating an archive. As directory, specify the top directory to be imported.
    Note that if the specified directory is not a directory configuration, all the files directly beneath the specified directory will be imported.
    To import all the files existing under the specified directory, do not include unnecessary files in the directory.
Note
To use a JavaBeans resource, you must resolve the references from the J2EE application to the JavaBeans resource. When you define the properties of a J2EE application that uses the JavaBeans resource, resolve the references from the J2EE application to the JavaBeans resource.

(2) Procedure for changing the settings of a JavaBeans resource

The following figure shows the procedure for changing the settings of a JavaBeans resource.

Figure 3-30 Procedure for changing the settings of a JavaBeans resource

[Figure]

A description of points 1 and 2 in the figure is as follows:

  1. Use the server management commands to stop the JavaBeans resource.
    Use the cjstopjb command to stop the JavaBeans resource. Note that before you stop the JavaBeans resource, stop all the J2EE applications that are using the JavaBeans resource.
  2. Use the server management commands to define the JavaBeans resource properties.
    Use the cjgetjbprop command to obtain the JavaBeans resource property file, edit the file, and then use the cjsetjbprop command to apply the edited content.
    For details on the content you can specify in the definition of the JavaBeans resource properties, see (4) Content that can be specified in the definition of the JavaBeans resource properties.

(3) Procedure for replacing the JavaBeans resource

The following figure shows the procedure for replacing the JavaBeans resource.

Figure 3-31 Procedure for replacing the JavaBeans resource

[Figure]

A description of points 1 to 4 in the figure is as follows:

  1. Use the server management commands to stop the JavaBeans resource.
    Use the cjstopjb command to stop the JavaBeans resource you want to replace. Note that before you stop the JavaBeans resource, stop all the J2EE applications that are using the JavaBeans resource.
  2. Restart the J2EE server.
    Use the cjstopsv command to stop the J2EE server, and then use the cjstartsv command to restart the J2EE server.
  3. Use the server management commands to delete the JavaBeans resource.
    Use the cjdeletejb command to delete the JavaBeans resource you want to replace.
  4. Use the server management commands to import the JavaBeans resource.
    Use the cjimportjb command to import a new JavaBeans resource.

(4) Content that can be specified in the definition of the JavaBeans resource properties

To set up new JavaBeans resource properties, use the template of the JavaBeans resource property file to create the JavaBeans resource property file, and then define the properties. Also, to change the settings, use the server management commands to obtain the JavaBeans resource property file, and then define the properties. Use the cjgetjbprop command to obtain the JavaBeans resource property file, edit the file, and then use the cjsetjbprop command to apply the edited content.

The following table describes the main content that can be specified in the definition of the JavaBeans resource properties.

Table 3-42 Main content that can be specified in the definition of the JavaBeans resource properties

CategoryItemSettings
Runtime propertiesResource typeSpecify the class name of the JavaBeans resource in the <res-type> tag.
Property informationSpecify the information in the following tags beneath the <property> tag:
  • Specify the method name of the set method and get method of the JavaBeans resource in the <property-name> tag.
  • Specify the argument type of the set method of the JavaBeans resource in the <property-type> tag.
  • Specify the value passed to the argument of the set method of the JavaBeans resource in the <property-value> tag.
Optional name informationOptional nameSpecify the optional name for the JavaBeans resource in the <resource-env-external-property>-<optional-name> tag, when you want to assign an optional name to the JavaBeans resource.
For the optional name settings, see 2.6.6 Setting the optional names for the J2EE resources.
Reference note
The <res-auth> attribute and <res-sharing-scope> attribute specified in the <resource-ref> tag of the DD (ra.xml) cannot be specified in the <resource-env-external-property> tag of the JavaBeans resource property file.