by Tomáš Matoušek & Ladislav Prošek
We have worked out the extended assignment, version A (only a Czech version is available at the moment). The server has no user interface at all. Clients have a Swing-based graphical user interface. As far as we know, all required functionality is implemented.
If you have a working MS Visual Studio .NET 2003 installation, just open OOS.sln OOS.sln and build the entire solution. If you don't have VS.NET but you have Windows, execute the Build.bat batch file. If you don't have Windows, you can build the project manually - process the OOS.idl file and then compile all *.java files in IDL/OOS, Client and Server directories.
If you have Windows, execute the RunServer.bat and RunClient.bat batch files. If you don't have Windows, you can run the programs manually - with all the Java- and Jacorb-related environment variables set appropriately, instruct your Java VM to execute ServerMain and ClientMain classes.
The server program expects one argument that specifies a name under which it registers itself in the Naming Service. The client program can also be given one argument that specifies a nick name of the client. However, if the argument is not given, user is requested to supply a nick name after the program is started.
The server program has no user interface at all. After you've run it, the only thing you can do is shut it down by pressing Ctrl+C.
The client program represents one client and has a Swing-based graphical user interface. In the left pane there is tree rooted with "News servers" node. Under this node it displays servers, under servers there are news groups and finally, clients are child nodes of the news groups they are subscribed to. There are seven buttons whose functionality might depend on the tree node that is currently selected.
In the right pane there are tabs representing the news groups this client is subscribed to, and clients with whom this client has some private communication. Type messages into the text line in the bottom and send them with ENTER. Detailed description is omitted since this part is pretty intuitive - especially for anyone who's ever used some kind of chat or instant messaging system.
The IDL file is IDL/OOS.idl. All string parameters are declared as wstring to support Czech characters. The implementation is quite straightforward (see javadoc-generated documentation).
Regarding the interconnected groups cycle issue: the graph of interconnected groups can contain cycles. Every message that is being forwarded among groups carries a list of groups where it has already been (see news group's forwardMessage operation). This means that a spanning tree is implicitly constructed every time a message is sent into one of the groups. This is a robust, bulletproof solution that might, however, suffer from bad scalability.
As for the dead client issue: the client's acceptMessage operation is declared oneway, so that a dead client does not affect the (single-threaded) message distribution. Moreover, there is thread in the server that periodically checks for dead clients and unsubscribes them.