13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

21.3 What’s in a Name? An Introducti<strong>on</strong> to JNDI483together. DNS can actually bind other informati<strong>on</strong>, such multiple alias namesfor a single can<strong>on</strong>ical name/IP pair, a mail handler name for a domain, andother general purpose data which the DNS administrator can choose to share.So, naming services are a way to join names and values together.Before we move <strong>on</strong>, let’s make sure we understand how general and universalthis c<strong>on</strong>cept is. A filesystem can be thought of as a naming service. AUNIX filename (like, say, /etc/inittab) can be thought of as a way of linkingthat name with the data it c<strong>on</strong>tains. So the key is the name (/etc/inittab)and the value could be either the data it c<strong>on</strong>tains, or perhaps a file handle that,when read, returns the data c<strong>on</strong>tained in the file. 3There are some other comm<strong>on</strong> features of naming systems that weshould point out. They are frequently hierarchical. A domain name such aswww.multitool.net actually indicates the host www in the multitool domainwithin the net domain. The name www.multitool.com is not related in anyway with the name www.multitool.net. They are c<strong>on</strong>tained in different topleveldomains. They do not intersect. Likewise, the name /etc/inittab wouldbe completely unrelated to, say, /tmp/inittab—because inittab is a file inthe etc directory, and inittab is a file in the tmp directory. So, most namingsystems are hierarchical. They differ in how the levels of the hierarchy are indicated,and in how absolute names are c<strong>on</strong>structed from comp<strong>on</strong>ents of thehierarchy, but they share this comm<strong>on</strong> c<strong>on</strong>cept.So, that’s naming. Next come directory c<strong>on</strong>cepts.A naming service is good, but what happens if you d<strong>on</strong>’t have the key andyou need to go looking? That’s what directories are for. C<strong>on</strong>sider the ls command.Why do you need it? Have you ever run it? Of course you have. Why?Because you often d<strong>on</strong>’t know the exact name of something or where exactlyit is in a naming system. You need to be able to look for what you want. Thatis the “directory” part of naming and directory services. You want somethingthat lets you query and browse the naming system to find what you want.The ls command will give you the complete c<strong>on</strong>tents of a directory, or itwill allow you to query a directory by specifying wildcard names. These are examplesof browse and query features. We’ll talk more about these c<strong>on</strong>cepts inrelati<strong>on</strong> to naming and directory systems in general and to JNDI in particular.3. The first case would be a name/value pair, the sec<strong>on</strong>d case would be a name/reference pair.The distincti<strong>on</strong> is often not important, but it does exist.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!