Naming-Service Concepts

In real life, a name provides an identity. People recognize and address you by your name. Similarly, in the world of distributed computing, objects are provided with identities. Because the underlying idea of distributed computing is reusability, objects need to interact with other objects to reuse functionality. To enable this, objects in the realm of distributed computing advertise the functionality that they provide. Objects advertise themselves by registering with a naming service. A naming service is a registry of objects advertising their functionality. Other objects or applications that need to access and use these functions contact the naming service and obtain the reference to the objects.

Figure 9.3 shows a typical naming service: Server objects register themselves with the naming service using name identifiers, and client applications obtain server object references by querying the naming service using the name identifiers of the server objects. The interactions between the server object and the naming service and between the client application and the naming service happen entirely by using the JNDI API.

Figure 9.3. Block diagram of clients and servers using a naming service.

graphics/09fig03.gif

Naming services have been a standard feature in distributed computing from the start. But a problem arises due to different service providers' offering proprietary implementations of naming services. Objects need to use different ways to access different implementations of naming services from different providers.

There are different naming services available. Here are some examples:

  • Domain Name Service (DNS) The DNS is one of the oldest naming services. A DNS is used for registering and accessing computers over a network such as a local network, an intranet, or the Internet. Computers on the network are uniquely identified by their IP addresses. For example, if you want your computer (that is, the Web site hosted on your computer) to be accessed over the Internet using a name such as www.mywebsite.com, you should register this name and your computer's IP address with the DNS provider. Once the name is registered, anyone wishing to access your Web site types in only the name. The networking software on the computer accessing your Web site contacts the DNS provider, queries it to obtain the IP address associated with the name, and connects to the computer hosting the Web site. All this happens seamlessly when you type in the URL of a Web site in your browser.

  • Remote Method Invocation (RMI) registry RMI is a classic example of distributed computing wherein your server applications reside on different computers on the network and register with a common RMI naming service. Client applications that need to locate and use the server applications contact the RMI naming service to obtain server object references.

  • Common Object Services (COS) naming service Similar to the RMI naming services, the COS naming service is used by CORBA (Common Object Request Broker Architecture) applications to locate and use CORBA server objects.

So how do naming services organize and store the information about the server objects? Figure 9.4 shows how the information about server objects, for example, the server object references associated with logical names, is organized in a hierarchical (tree) format. Organizing information in a hierarchical way enables the association and linking of information about interrelated server objects. As an example, if you have developed a software application for your company as a set of server component modules to be used by other applications in the company, you could organize and register the server components based on their functional use. One way to do this would be to establish a hierarchy while registering the server components with the naming service, such as by registering AccountsReceivable, Inventory under the AccountsPkg hierarchy (because these are related in functionality) and PersonnelFile, AppraisalReports under the HRPkg module. This will help client applications to traverse the naming service tree quickly and to locate the objects of interest easily.

Figure 9.4. Objects in a naming service.

graphics/09fig04.gif

One important point to note here is how naming services store the server object information. There are two policies that naming services adopt: transient and persistent.

A naming service that is transient maintains the server object information registered with it as long as the naming service is active and running. The registration information of server objects will be lost if the naming service shuts down or is restarted. Persistent naming services, on the other hand, maintain their contents in a persistent store. After a naming service is restarted, the entire hierarchy of server objects is rebuilt, and the state of the naming service is restored. This persistence is especially important in mission-critical and fail-safe applications.

Now that you have studied the basics of naming services, you can take a look at directory services.



Sams Teach Yourself BEA WebLogic Server 7. 0 in 21 Days
Sams Teach Yourself BEA WebLogic Server 7.0 in 21 Days
ISBN: 0672324334
EAN: 2147483647
Year: 2002
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net