In this subsection, we will describe the Smart Clients API. The goal of the API is to provide a generic interface for service providers to develop transparent access to their servers and to make it easier for programmers to implement applications for distributed services. In the interests of brevity, we do not document the interface in its entirety. Interested readers can download the Java classes implementing the API to see how the classes are used to implement a number of sample applications (as described in Section 4).
: This Figure describes some of the interfaces in the Smart Clients API.
Classes that implement the director interface have been written to
provide much of the functionality necessary to simple directors, including
randomized directors (picking a random machine) and directors based on choosing the
least loaded server.
Figure 5 presents a high-level overview of the Java methods which make up the Smart Clients API. The IDirector interface provides a simple abstraction of a service to the application programmer. The programmer makes director requests through the IDirector interface. The requests are then sent by the director applet to one of the service nodes; note that the application programmer is not concerned with managing server nodes. If the request fails, a director exception is raised. In response, the director will first allow the request to clean up any state, then resend the request to another server. The director applet takes a best effort approach in delivering the request. Thus, a return of false from the delivery request indicates a catastrophic failure of the service, i.e. all servers have failed.