The Environment Class

The Environment class shown below is intended to encapsulate the details of the local environment for the JNDI server. In this particular example, all information is retrieved through the program, but this is information that could just as easily have been retrieved from a properties file, an XML document, or a database. Since we regard the location of the directory server to be relatively static information (moving or renaming the host for a directory server to a new name would have a significant impact on the network), retrieving this information from a localized class should not present a problem.

This class does the majority of its work in the constructor. It creates a Hashtable and loads it with the correct parameters ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.