Chapter 14. The RMI Registry
RMI provides a simple naming service called the RMI registry, which we’ve already used in our examples. Now that we’ve built a few distributed applications and understand threading, it’s time to revisit the RMI registry. After a preliminary discussion of naming services, we’ll spend most of this chapter examining the RMI registry in detail, discussing both how it works and how to use it in applications. By the end of this chapter, you will not only understand how to use the RMI registry, you’ll have a basic understanding of naming services as well.
Why Use a Naming Service?
The first step in discussing naming services is to be a little clearer about what they are and what problems they solve. A first attempt at a definition may look something like the following:
A naming service is a centralized resource that a number of applications use as a “phone book"-like resource. That is, it is an easily locatable and well-known application that maps logical names to actual servers so client programs can easily locate and use appropriate server applications.
This definition is intentionally vague on two points. First, it doesn’t define what is meant by “phone book” or “logical names.” And second, it doesn’t specify what a naming service returns. This is because there are a wide range of servers that claim to be naming services. And many of these services use slightly different meanings for these two points. For example, in the case of the RMI registry, we have: ...
Get Java RMI now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.