Check out the new USENIX Web site. next up previous
Next: Publishing Up: Programming Example Previous: Background: Distributed Asynchronous Collections

A Chat Scenario

We concentrate on two chat addicts, Alice and Bob, who love to chat deep into the night. Therefore they subscribe to the topic /Chat/Insomnia to receive all messages from like-minded chatters. Figure 12 shows class ChatMsg, which represents a possible message class for this application.

public class ChatMsg 
  private String sender; 
  private String text;
  public String getSender() { return sender; }
  public String getText() { return text; }
  public ChatMsg(String sender, String text) { 
    this.sender = sender; this.text = text; }

Figure 12: Event Class for Chat Example

Patrick Eugster