NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
One possible MathType for the data to be passed to a client is: ( ((x, y) -> surface), (list -> word), (list -> title), (list -> document) ) where word, title and docuement are all TextTypes and x, y, surface and list are RealTypes (clearly, list will only take integer values). Currently, VisAD Displays do nothing with text information, so text values will need to be displayed in JFC components as you say. You could divide this MathType into four seperate Data objects. If you wanted to use VisAD Data objects for communications back from client to server, you could add other small Data objects for that purpose. The server could link these small Data objects to CellImpls whose doAction methods would respond to user changes (the way RealTuple Data objects are used as custom cursors in DisplayTest case 27, and linked to a CellImpl). A server can set up an array of RemoteDataReferenceImpls (accessed by clients as RemoteDataReferences) in a RemoteServerImpl object (the paoloa/GoesCollaboration.java program is an example of doing this). The server can dynamically extend its array of RemoteDataReferenceImpls using the RemoteServerImpl.setDataReference method (much like adding members to Vectors). This could be used to add a unique set of RemoteDataReferenceImpls for each cleint (by which each client can access its set of Data objects). Of course, you need a way for each client to get a unique integer id. You could do it by extending the RemoteServerImpl class and the RemoteServer interface, adding a method like this: private static int ID = 0; // count of connected clients public synchronized int getID() throws RemoteException { ID++; // add a new client // set up new Data objects and RemoteDataReferenceImpls // for client and add them to RemoteDataReferenceImpl array // at indices: NDATA * ID, NDATA * ID + 1, ..., // NDATA * ID + NDATA - 1 (where NDATA is the number of // Data objects per client) return ID; // return unique ID to client } Or you could create this method in an RMI class / interface pair similar to RemoteServerImpl and RemoteServer, but without extending them. > What about RMI in general. Is it best for collaboration or can > it be used effectively for many clients contacting one server? > > Two other solutions are Cobra and sockets (TCP or UDP). I've > seen sample servers for each but cannot determine which > solution is recommended for VisAD applications. RMI can be viewed as a fundamental communication mechanism, and so can support any sort of application structure as long as its written in Java. Corba is like RMI, except that it is a lot more complex, can support languages other than Java, and cannot pass objects by copy the way RMI does. TCP and UDP are much lower level that RMI and Corba - in fact RMI runs on top of TCP sockets. As long as you're working in Java, I recommend RMI. Please let me know when you have further questions. Bill ---------------------------------------------------------- Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI 53706 whibbard@xxxxxxxxxxxxx 608-263-4427 fax: 608-263-6738 http://www.ssec.wisc.edu/~billh/vis.html "kill cross-platform Java by growing the polluted Java market" - from an internal Microsoft planning document
visad
archives: