Java Reference
In-Depth Information
21.2.3
We're not going to take apart the source code for JBoss here, but we do want
to spend some time talking about what is going on in an EJB container. It isn't
magic. The whole system is built on some familiar technologies that you can
learn all about if you want to. First of all, the default protocol for EJB session
and entity beans is RMI. That's right. A major part of an EJB container is the
code to set up RMI connections between beans and clients. RMI is an applica-
tion protocol that defines how to encode the state of a Java class, transfer it over
a network (using TCP/IP sockets), and restore the coded data to a local imple-
mentation of the class (the encoding/decoding process is called marshaling/
unmarshaling ). That's part one. Knowing where to find the appropriate bean
is the next part.
Under the Hood
21.3
W HAT ' SINA N AME ? A N I NTRODUCTION TO JNDI
JNDI abstracts a type of service known generically as a directory service. We
need to introduce that concept and then describe a few common examples of
such systems. Then we can explain how JNDI abstracts these various services.
21.3.1
Directory services are one of the dark mysteries of modern computing. Why?
Because if the people who developed these systems ever let on how simple they
actually are, everyone would understand and be able to use them well. Then
where would we be?
In practice, a naming system is what we programmers call an associative
array, or, when we are feeling less verbose, a simple hash of name/value pairs.
That's it. The core concept isn't any more complicated than that. The most
familiar naming service out there (one that we are sure you use every day)
is the Internet Domain Name Service, or DNS. This is a system that maps
domain names (like www.somedumbnetwork.net ) to IP addresses (like
205.117.29.1 ). In the world of directory services, such a name/value pair is
called a binding .
Of course, the devil is in the details. DNS is implemented by a complex
network of name servers that pass requests up and down a distributed hierarchy
of name servers. That part can get quite complex, but the core idea is that you
have a name (the domain name) and a value (an IP address) that you join
Naming and Directory System Concepts
Search WWH ::




Custom Search