From: Arlindo da S. <da...@al...> - 2009-01-15 16:42:37
|
Dear Pedro, I have a question for you regarding a client/server split of GrADS, much along the lines of what youy did 10 years ago. My main interest is to be able to run the core GrADS on the machine where the data resides and do the plotting locally on my laptop while sipping coffee at Starbucks. Of course OPeNDAP allow some of this functionality, but doing server-side operations in GDS is just a bit restricted. My current approach for *grads.jar* is based on NestedVM and creates sort of a "single executable". Strictly speaking, it is not client-server. However, there is a very natural "fold" for a client/server split: most of the system is based on the C sources compiled into java byte code through NestedVM; I'll refer to this part of the system loosely as the "C code". There are only 2 files with actual java code: 1. *JGrads.java *which contains main(): the NestedVM class "*grads*" is called several times: once for initialization and then in a while loop (function *GaCmd*) so that I can use JLine (readline replacement). 2. *gxJ.java*: adaption of your original code. These gets called from within the "C code" through a callback setup that gets done in * JGrads.java.* Therefore, one could say that the "*C code*" part of the system is the * server*, while *JGrads.java* is the *client*. This split is very different from what you have conceived originally because now most of the graphics is done server-side, only the final rendering using the gx primitives is done client-side. A good thing about it is that any improvements Brian makes to the plotting routines are readily available. The graphics primitives are much less likely to change, so it is much easier to maintain. On the down side, the server does most of the work. Now, the thorny issue: how to handle the fact that the "C code" calls back java for the graphics primitives. Although it is not setup this way right now, perhaps we could have some non-blocking way of calling *GaCmd *with subsequent queries to the server for the graphics primitives requests/end of command events. I was thinking about a *GradsVM.java* class that wraps around the "C code " and provides what is necessary for implementing this (for example, buffering the graphics primitives' requests.) How would you do it? I have close to zero experience in Java, there is probably more elegant ways of doing this. Thanks, Arlindo -- Arlindo da Silva da...@al... |