Java Dynamic Management Kit 5.1 Tutorial

10.1 Initial Configuration

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:

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.

10.1.1 External RMI Registry

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"

10.1.2 External CORBA Naming Service

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"

10.1.3 External LDAP registry

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:

You are now ready to run the different lookup service examples.