![]() |
|||
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
| ||||||||||
Chapter 10Lookup ServicesThe Java Management Extensions (JMX) Remote API specification defines three bindings to lookup services, using existing lookup technologies, as described in the following sections:
This chapter provides an introduction to the lookup services provided by Java DMK using three sets of examples. For a full description of the lookup services, see the JMX Remote API 1.0 Specification document. 10.1 Initial ConfigurationAs 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 RegistryTo 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:
For your convenience when typing commands, create an environment variable for the address of the RMI registry.
10.1.2 External CORBA Naming ServiceTo register connector stubs in the CORBA naming service, you must start an ORB daemon, with the following commands:
For your convenience when typing commands, create an environment variable for the address of the CORBA naming service.
10.1.3 External LDAP registryTo 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:
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. 10.2 Service Location Protocol (SLP) Lookup ServiceJava DMK 5.1 specifies how to register RMI connectors or JMXMP connectors with the SLP lookup service. The purpose of this example is to demonstrate how a connector client can find and connect to a connector server that has registered with the SLP lookup service. This example performs the following operations:
| ||||||||||
| ||||||||||
![]() |