Explain different properties of Java beans || TechMoodly

Naming and Directory Services

Image result for detailed note on Java Naming and Directory Service

A Naming Service provides a mechanism for giving names to objects so you can retrieve and use those objects without knowing the location of the object. Objects can be located on any machine accessible from your network, not necessarily the local workstation.
A real-world example is a phone directory. It stores telephone numbers against names and addresses. To find people's phone numbers is simply a matter of using their name (and possibly address) to identify an entry in the phone book and obtaining the stored phone number. There are a few complications, such as finding the right phone book to look in, but it is essentially a simple process.
Incidentally, naming services have a similar problem to that of finding the right phone book. This is known as obtaining a context. A name can only be found if you examine the right context (phone book).
A Directory Service also associates names with objects but provides additional information by associating attributes with the objects.
The yellow pages phone directory is a simple form of a directory service. Here, businesses often include advertisements with additional information such as a list of products sold, professional qualifications, affiliated organizations, and even maps to their premises. These attributes add value to the name entry. A directory service will normally provide the ability to find entries that have particular attributes or values for attributes. This is similar to searching the yellow pages for all plumbers running a 24-hour emergency service within a certain area.
Yellow page style phone books also store names under categories—for example, hairdressers or lawyers. Categorizing entries can simplify searching for a particular type of entry. These categorized entries are a form of sub-context within the directory context of the local phone book.

Why Use a Naming or Directory Service?

Naming Services provide an indispensable mechanism for de-coupling the provider of a service from the consumer of the service. Naming services allow a supplier of a service to register their service against a name. Users, or clients, of the service need only know the name of the service to use it.
Think of the phone book once more, and how difficult it would be to find someone's phone number without it. Obtaining your friend's phone number would mean going to their home and asking, or waiting until you meet up with them again—which may be difficult to organize because you can't phone them to arrange the meeting.
At the end of the day, it is very difficult to imagine a world without naming services.

What Is JNDI?

JNDI is a Java API that defines an interface to Naming and Directory Services for Java programs. JNDI is just an API and not, in itself, a Naming and Directory Service. To use JNDI, an implementation of a Naming and Directory service must be available. JNDI provides a service-independent interface to the underlying Service Provider implementation.
Figure 3.1 shows how the JNDI layer interfaces between the Java program and the underlying naming services. Additional naming services can be plugged into the JNDI layer by implementing the Service Provider Interface (SPI) for JNDI.
Figure 3.1Figure 3.1 JNDI Architecture.
JNDI has been a standard component of J2SE since version 1.3. JNDI is available as a standard Java extension for JDK 1.2 and earlier. JNDI has always been a required component of J2EE.

Common Naming Services

Figure 3.1 shows that JNDI supports plug-in Service Providers for several well-known naming services, including the following:
  • Lightweight Directory Access Protocol (LDAP) is the approved standard for an Internet naming service. LDAP is a true directory service and supports attributes as well as names for objects. LDAP is fast becoming the de facto directory service for the enterprise.
  • Domain Name System (DNS) is the Internet naming service for identifying machines on a network.
  • Novell Directory Services (NDS) from Novell provides information about network services, such as files and printers. NDS is found primarily in environments where the main networking software is Novell.
  • Network Information Service (NIS) from Sun Microsystems provides system-wide information about machines, files, users, printers, and networks. NIS is primarily found on Solaris systems, but Linux and some other Unix platforms also support it.
JNDI also supports some more specialized naming systems. For example, CORBA for distributed component programming and RMI for distributed Java programming.

@Copyright 2019 Bigahi .| All Rights Reserved || Created By Bigahi Gaon ||