I think I have the proper structure for rmi commiunication. A remote interface extending remote and serializable, an implementation class extending unicast remote object, exported using registry's rebind method, fetched at the other side using naming.lookup(). The class cast exception was me casting to the wrong type, sorry for raising uneeded alarm on that
I used the same client for stand-alone and network and for stand-alone, its working fine. The map is a return value of one of the methods in the database. It only returns a copy of the actual map in the database not the real one (of course I know the implications of what you thought there Roel). It is the database that I exported with a wrapper (similar to exporting a factory that houses a single database -- my methods would then not be forced to include the throws clause for remote exeption, crappy shortcut there eh?). My approach is quite similar to that of Andrew Munkhouse in his
SCJD book only that I extended the DB interface to add a few convinience methods. Data class passed locking Roberto's locking (with a hundred thousand threads, i was just having fun with threads
). Classes in the diferent packages are loosely coupled (so I can completely wipe out all the netwok stuffs without touching the GUI code). MVC employed in the JTable. It is only in the connectToDataSource(AppMode mode, Configuration config) that the GUI code obtains a reference of the database based on the application mode (local or network) and the rest of the system is not aware whether the database is local or remote.