Java Reference
In-Depth Information
Figure 4.2. Session component for a client-matching session
A second Session component diagram, this time for server-maintained sessions, is shown in
Figure 4.3
.
Figure 4.3. Session component for server-maintained sessions
A Session tracker diagram is shown in
Figure 4.4
.
Figure 4.4. Session tracker
In this example, the client requester uses the server to perform a series of operations for updating contact
information in a shared address book. A user can perform four operations:
Add a contact
Add an address (associated with the current contact)
Remove an address (associated with the current contact)
Save the contact and address changes
These operations are defined in the class
SessionClient
.
Example 4.6
SessionClient.java
1. import java.net.MalformedURLException;
2. import java.rmi.Naming;