2.7.3 Settings required for performing a round-robin search

This subsection describes the settings required for performing a round-robin search and the naming rules of the group names.

The following settings are required when performing a round-robin search:

To use the round-robin search functionality, you specify the settings in the system properties. Note that in addition to the system property settings, you can also specify the classes to which the implementation of InitialContextFactory is delegated, as arguments when generating InitialContext of each application. In the arguments used for generating InitialContext, you can select and specify a specific naming service from the group of logical naming services specified in the system properties.

Note that when the settings are only specified in the system properties, you cannot perform a round-robin search specifying a specific group. The naming services of all the groups existing on the logical naming service are included in the scope of search.

The following is an overview of each setting method:

Organization of this subsection
(1) Identifying the groups from the system property settings and the root position of the CORBA Naming Service belonging to that group
(2) For the J2EE applications (Enterprise Beans or servlets) running on the J2EE server
(3) For the EJB client applications running on servers other than the J2EE server
(4) Selecting the group to be searched based on the argument specified for generating InitialContext
(5) Naming rules for the group names
(6) Settings in the properties
(7) Properties with different specification requirements depending on the commands (for the EJB client applications)

(1) Identifying the groups from the system property settings and the root position of the CORBA Naming Service belonging to that group

When executing the round-robin search, you specify the group of logical naming services to be searched by a round-robin search and the root position of the naming services belonging to the group, in the system properties. Also, you must specify java.naming.factory.initial=com.hitachi.software.ejb.jndi.GroupContextFactory as the class to which the implementation of InitialContextFactory is delegated.

The method of setting up the system properties differs at the following locations for the various types of applications that use the round-robin search functionality.

(2) For the J2EE applications (Enterprise Beans or servlets) running on the J2EE server

You customize and set up the J2EE server properties. Specify the settings in the user properties for J2EE servers in the Easy Setup definition file.

You specify the definition for the round-robin search in the <configuration> tag of the logical J2EE server (j2ee-server) in the Easy Setup definition file. The following table describes the definitions for performing a round-robin search in the Easy Setup definition file.

Table 2-31 Definition for performing a round-robin search in the Easy Setup definition file

Specified parametersSettings
ejbserver.jndi.namingservice.group.listSpecify the CORBA Naming Service group.
ejbserver.jndi.namingservice.group.Specify-group-name.providerurlsSpecify the root position of the CORBA Naming Services belonging to each group.
java.naming.factory.initialSpecify the class to which the implementation of InitialContextFactory is delegated.

Note that the round-robin search presumes the use of the user-specified name space functionality. When you use the user-specified name space functionality, you need to customize the settings for operating the server management commands and define the J2EE application properties. For details on the settings, see 2.6.7 Execution environment settings and 2.6.5 Setting the optional names for the Enterprise Beans.

(3) For the EJB client applications running on servers other than the J2EE server

You use one of the following methods to specify the settings:

Note that the method of setting the EJB client application properties differs depending on the commands used for starting the EJB client application. This subsection describes how to set the EJB client application properties and the examples of specification.

(a) Methods of setting the EJB client application properties

The method of setting the properties differs when the cjclstartap command is used and when the vbj command is used.

(b) Example of specifying the properties

An example of specification is as follows. This is an example of specifying the properties in usrconf.properties. For details on each key, see 14.3 usrconf.properties (User property file for Java applications) in the uCosminexus Application Server Definition Reference Guide.

# Define the logical naming service configuration
ejbserver.jndi.namingservice.group.list=g1;g2;g3
ejbserver.jndi.namingservice.group.g1.providerurls=corbaname::hostA:900;corbaname::hostB:900
ejbserver.jndi.namingservice.group.g2.providerurls=corbaname::hostD:700;corbaname::hostE:700
ejbserver.jndi.namingservice.group.g3.providerurls=corbaname::hostF:800;corbaname::hostG:800
# Specify the class to which the implementation of InitialContextFactory is delegated
java.naming.factory.initial=com.hitachi.software.ejb.jndi.GroupContextFactory
:

The following contents are specified in the ejbserver.jndi.namingservice.group.list key, ejbserver.jndi.namingservice.group.Specify-group-name.providerurls key, and java.naming.factory.initial key respectively in the example of specification:

ejbserver.jndi.namingservice.group.list key
When performing a round-robin search, define the group of the logical naming services that is to be searched. Specify each group name so that it can be uniquely identified in logical naming.
ejbserver.jndi.namingservice.group.Specify-group-name.providerurls key
You specify the root position of the naming service belonging to each group in the provider URL. In Specify-group-name, you specify the group name specified in ejbserver.jndi.namingservice.group.list.
java.naming.factory.initial key
You specify the class to which the implementation of InitialContextFactory is delegated.
If you specify com.hitachi.software.ejb.jndi.GroupContextFactory in the java.naming.factory.initial key, a round-robin search is implemented. If you do not specify com.hitachi.software.ejb.jndi.GroupContextFactory in the java.naming.factory.initial key, the CORBA Naming Service used by the J2EE server is searched.
Note that if you specify the java.naming.factory.initial key as an argument when generating InitialContext in the method described in (4) Selecting the group to be searched based on the argument specified for generating InitialContext, you need not specify a value for this key in the system properties.

(4) Selecting the group to be searched based on the argument specified for generating InitialContext

When settings are specified for executing a round-robin search, you can select a specific group to be looked up in the round-robin search targets by specifying the group as an argument for generating InitialContext in the client application. Note that the specification of an argument for generating InitialContext is optional.

An example of specification is as follows:

:
Hashtable env = new Hashtable();
env.put("ejbserver.jndi.namingservice.groupname", "g1");
env.put("java.naming.factory.initial",
"com.hitachi.software.ejb.jndi.GroupContextFactory");
InitialContext ic = new InitialContext(env);
:

The following contents are specified in the ejbserver.jndi.namingservice.groupname key and the java.naming.factory.initial key respectively in the example of specification:

ejbserver.jndi.namingservice.groupname key
You specify the group name to be searched in the 'gl' portion. Specify the group name that is already defined in system properties (ejbserver.jndi.namingservice.group.list key of usrconf.properties). Note that ejbserver.jndi.namingservice.groupname key does not have a default value. When you do not specify a group name, all the groups set in the system properties are searched.
java.naming.factory.initial key
You specify the class to which the implementation of InitialContextFactory is delegated. If you specify com.hitachi.software.ejb.jndi.GroupContextFactory in the java.naming.factory.initial key, a round-robin search is implemented. When you omit the specification in the java.naming.factory.initial key of the system properties and if you do not specify this key in the argument, the group specified in the ejbserver.jndi.namingservice.groupname key is not searched and the CORBA Naming Service used by the J2EE server is searched.

(5) Naming rules for the group names

You can use the following characters in a group name:

Make sure to specify a group name that is unique in the logical naming service.

(6) Settings in the properties

The EJB client application properties are used when the Enterprise Beans are invoked from the Java application. Set the required properties according to the contents of the J2EE application. For details on the properties that can be set, see the uCosminexus Application Server Definition Reference Guide.

Example of contents that can be set in the properties
  • Log settings for the EJB client applications
    You use the keys beginning with ejbserver.client.log and the keys beginning with ejbserver.logger to change the output destination and the log level of the system log output by the system and the user log output by the EJB client applications. For details on the system log, see 3.8 System log output by the EJB client applications in the uCosminexus Application Server EJB Container Functionality Guide, and for details on the user log, see 9. User log output by the applications in the uCosminexus Application Server Expansion Guide.
  • Transactions settings for the EJB client applications
    You use the keys beginning with ejbserver.client.transaction to specify whether to use transactions with the EJB client applications and to specify the client name to be used by the transaction service. Note that when you use uCosminexus Client to set up the EJB client environment, you cannot use the EJB client application transactions. For details, see 3.20 Notes on starting a transaction with the EJB client applications.
  • EJB client operations in the case of communication error in the EJB remote interface
    In the ejbserver.container.rebindpolicy key, you can specify the re-connect operation for the connections and the re-send operation for the requests in the EJB client.
  • Settings for executing the round-robin search from the EJB client applications
    In the ejbserver.jndi.namingservice.group.list key, ejbserver.jndi.namingservice.group.specify-group-name.providerurls key, and java.naming.factory.initial key, you can specify the CORBA Naming Service group, the root position of the CORBA Naming Service belonging to each group, and the class to which the implementation of InitialContextFactory is delegated. Note that the round-robin search is enabled when you specify the user-specified name space functionality during the customization of the server management commands for the J2EE server.
  • Setting the priority of requests from the EJB client applications to the CTM
    In the ejbserver.client.ctm.RequestPriority key, you can set the priority for the requests to be sent from the EJB client applications to the CTM.

(7) Properties with different specification requirements depending on the commands (for the EJB client applications)

This subsection describes the properties with different specification requirements depending on the EJB client application commands (vbj command). The following table lists the property keys with different specification requirements depending on the EJB client application commands.

Table 2-32 Property keys with different specification requirements depending on the EJB client application commands

Property keysTypeCommands
cjclstartapvbj
org.omg.CORBA.ORBClassFixedNN
org.omg.CORBA.ORBSingletonClassFixedNN
javax.rmi.CORBA.UtilClassFixedNY
javax.rmi.CORBA.StubClassFixedNN
javax.rmi.CORBA.PortableRemoteObjectClassFixedNY
java.endorsed.dirsVariableNN
Legend:
Fixed: Value for the applicable key is fixed and must be specified
Variable: Value must be specified according to the system execution environment
Y: Key must be specified for the command
N: Key need not be specified for the command