One of the greatest advantages which Jserv brings to Apache is ability to leverage the large number of API's available to Java. Remote Method Invocation (RMI) delivers several significant benefits to the servlet solution. The primary benefit of using RMI with servlets is that it significantly expands the variety of datasources which Apache can serve to the browser. Furthermore, RMI's simplifies code on the client side of the RMI connection (the servlet), and also allows for load distribution.
As you can see, RMI allowed us to host the Directory service on a machine separate from the web server. Not only does this allow us to load balance applications, but it also allows your Apache Jserv box to connect to data sources hosted on different machines with different OS's. For example, in a two tier approach, a WinNT or Solaris server could host the the database or application server, and your Linux Apache-Jserv machine would then access the data sources via RMI.
The code on the client side is fairly straightforward. The servlet only knows about the Directory interface, and all the code dealing with the data storage & retrieval is hidden behind that interface. The RMI service implementation, server.AddressBook is a simple example, using a HashMap to store the data. A more robust Directory implementation data would store its data in a database or LDAP server. For the servlet (RMI client), it doesn't matter where the data is coming from; it's happy as long as the service implementing the directory.Directory interface is available from the RMI registry.