The DDJ Chat Applications

For your first examples of JSDT systems, you should take a look at the examples in the JSDT download, including chat, whiteboard, stock quotes, phone, synthesizer, and a music server.

This chat application goes a step beyond the chat example by demonstrating several additional features of JSDT. It shows, among other things, how to monitor what is happening in the JSDT, by using Listeners such as SessionListener, how to query the SessionFactory about current Sessions and a Session about its Clients, and how to isolate the JSDT from the upper application layers. This example includes some of the latest features from JSDT 2.0 such as the RegistryListener.

The client-side and server-side GUIs let you monitor what's going on with the Sessions, to give you a better understanding of how the JSDT works.

The extensive comments are meant to explain some of the aspects of JSDT.

How to run the applications:

  1. Of course, you need a virtual machine, such as the Sun Java Runtime Environment, in your system path.
  2. You need the JSDT classes, packaged in jsdt.jar. To work with the JSDT, get the latest Beta at the Java Developer Connection. This example was developed with the JSDT 2.0 Beta version.
  3. Put jsdt.jar in in your CLASSPATH. (You might want to bundle jsdt.jar with your class files as I have done, by putting it in the root directory from which you run your class files.)
  4. Compile the included source code.
  5. Modify sessions.properties to give a list of Sessions to start at start-up time. You can also add Sessions at run-time with the "add sessions" button.
  6. run
    java ddj.DDJChatServer
    as a process separate from any of the ChatApplications. This provides a GUI which you can use to monitor the Registry, as well as a button to stop the Registry and a button to add Sessions.
  7. Run the ChatApplication with
    java ddj.ChatApplication serverName
    For a simple test-run, you will probably enter
    java ddj.ChatApplication localhost
  8. To use the ChatApplication, enter a client name in the appropriate text-field. Each client needs a different name. Each client can join a Session by choosing it from the list.
  9. Use the various GUI elements to monitor how the JSDT maintains its shared objects.
  10. Use the disconnect button to disconnect from the Session.
  11. Close the window to close the ChatApplication and leave the JSDT system entirely.



Directories/files in this distribution: