< Zurück | Inhalt | Weiter >

21.3.4 Using JNDI with JBoss

For our purposes, it is important to know that JBoss uses JNDI to provide much of the EJB container infrastructure. The primary use is to look up the EJBs, as we shall see in the code examples in the following chapters.


We covered the basic concepts behind the various types of EJBs. We talked about the events in the life of a bean. From here we will go on to describe actual implementations and discuss how a bean is written and deployed to a J2EE container.


11. If you are a relatively unschooled net hooligan, let us assure you that this is only “in theory.” Before you go off and attempt a DoS attack on the entire Internet with a simple Java class like this, we have to tell you that JNDI DNS enumerations depend on a DNS protocol feature called zone transfers. Most high-level DNS servers will not do zone transfers at all, and many will only accept zone transfer requests from internal addresses. Sorry.

12. http://java.sun.com/products/jndi/tutorial


Where to begin? Your humble authors themselves are still learning the intrica- cies of J2EE. We have more or less ignored message beans. We have not de- scribed the local and local home interfaces, concentrating instead on the remote access of beans. This is because remote access is what client applications will most often use. But entity beans, for example, can only call one another through the local interface, and, in practice, a session bean will likely provide remote access but call any other beans through a local interface.

A quick examination of your local bookstore’s computer books section will reveal that J2EE is a vast topic, just by the number of books on the topic and their thickness. Our goal here is to give you enough to make a quick start in using EJBs on a Linux-hosted application server. From there—well, those thick books are probably your next stop.



is Sun’s JNDI tutorial.

• Sun has a J2EE tutorial (http://java.sun.com/j2ee/1.4/docs/ tutorial/doc/index.php) that is a great place to start.