As shown simply in Chapter 9, Protocol Connectors, if you are using remote method invocation (RMI) connectors, you can choose to use an external directory to register the connector server stubs you want to look up. The following cases are presented in the lookup service examples relating to RMI connectors:
RMI connectors using one of the following external directories:
An RMI registry, for RMI connectors implementing the default Java Remote Method Protocol (JRMP) transport.
CORBA Naming Service, for RMI connectors implementing the Internet Inter-ORB Protocol (IIOP) transport.
LDAP, for both the IIOP and JRMP transports.
RMI connectors without an external directory.
If you choose to register the RMI connector stubs in an external directory, some initial configuration is required, to set up your RMI registry, CORBA naming service or LDAP server. If you do not use an external directory, the RMI connector stub is encoded into the JMX service URL.
The lookup service examples for the JMX messaging protocol (JMXMP) connector do not use any external directories.
The following sections describe the external directories that you can use in conjunction with the lookup service examples that use RMI connectors. These external directories are referred to when running the three examples of lookup services that are given in the subsequent sections in this chapter.
In these examples, the addresses of the different registries are given as URLs in JNDI form. For an explanation of JNDI form, see the API documentation for the javax.management.remote.rmi package. If you want to run the external directories on a machine other than the local machine, you must specify that machine's host name instead of localhost.
To register the RMI connector server stubs in an external RMI registry, for use by connectors implementing the JRMP transport, start an RMI registry with the following command:
$ rmiregistry 9999 & |
For your convenience when typing commands, create an environment variable for the address of the RMI registry.
$ jndirmi="rmi://localhost:9999" |
To register connector stubs in the CORBA naming service, you must start an ORB daemon, with the following commands:
$ rm -rf ./orb.db $ orbd -ORBInitialPort 7777 & |
For your convenience when typing commands, create an environment variable for the address of the CORBA naming service.
$ jndiiiop="iiop://localhost:7777" |
To register connector stubs in an LDAP registry, you must start an LDAP server. The LDAP server you use is your choice, although the schema for representing Java objects in an LDAP directory must be known to the server. See the Request For Comments (RFC) document RFC 2713for details.
Once you have started your LDAP server, in to create a directory context under which you have the permission to create new nodes, create a new component suffix:
dc=Test |
See the documentation accompanying your LDAP server for details of how to configure the server and create this suffix. Alternatively, if you already have the appropriate rights of node creation under an existing node, you can use that node instead. In that case, you must replace dc=Test with the name of your node wherever dc=Test appears in these examples.
For your convenience, set the following LDAP parameters as environment variables:
The name of the machine running your LDAP server (ldap_host):
$ ldaphost=ldap_host |
The port the LDAP server is running on (ldap_port):
$ ldapport=ldap_port |
The LDAP common name attribute, which in these examples is “Directory Manager”:
$ principal="cn=Directory Manager" |
The password required by your LDAP server:
$ credentials=your_ldap_password |
The address of the LDAP server:
$ jndildap="ldap://$ldaphost:$ldapport" |
You are now ready to run the different lookup service examples.