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.
[I am re-sending this because I don't think it worked the first time I sent it. Doug, please let me know if you get this. Thanks.] Hi Doug, > I have a data server running with VisAD data objects only (no display). > I have a client that gets data references from the server (based on > Test14,15) and does the display. I am having some confusion about where > I need to use Remote objects. > > - Does my client need a RemoteDisplayImpl or can I add > RemoteDataReference's to a local DisplayImpl? Yes, the client needs to construct a RemoteDisplayImpl (constructor argument is the local DisplayImpl) to link (via addReference or addReferences) with the RemoteDataReference. > I read that one can add a > RemoteDataReferenceImpl to a local DisplayImpl, but I can't seem to cast > my RemoteDataReference to a RemoteDataReferenceImpl. That must be error. If you can recall where you read it, I'll correct it. > I'll settle for a > simple "Yes" here. I have it working, but I don't want to add extra > overhead if it is not needed. In general, VisAD requires that local objects only be linked with local objects, and remote objects only linked with remote objects. When you need a remote object to link, you can construct it from the local object. For example, new RemoteDisplayImpl(DisplayImpl display) and new RemoteDataReferenceImpl(DataReferenceImpl ref). > - The client application needs to get some data values (doubles) from > the server. When I run the server as part of the same JVM (using none of > the Remote stuff) I can use the DataReference getData method and cast > that to a FieldImpl and call its getValues method. Running remotely, I > can't seem to cast the results of the (remote)DataReference getData > method to something like RemoteFieldImpl so I can call a getValues > method. Do I need a RemoteFieldImpl on the server? If the argument to DataReference.setData(Data d) on the server is a FieldImpl, then you should be able to cast the return value of DataReference.getData() to FieldImpl. That is, moving data from the server to the client does not change its class to Remote*. If the server does setData(RemoteFieldImpl field) then the client can cast (RemoteField) getData(). The client sees the remote data through the RemoteField interface, and the server implements this interface using the RemoteFieldImpl class. The client does not see RemoteFieldImpl directly, but only through the RemoteField interface. You would only use RemoteFieldImpl and RemoteField in this way to avoid the expense of copying the entire Field data object from server to client. If you want the getData() call on the client to immediately download the data from the server, then use setData(FieldImpl field) on the server, and cast as (FieldImpl) getData() on the client. Even if the server serves a RemoteFieldImpl, the client can force it to be local using: FieldImpl field = (FieldImpl) (ref.getData().local()); I know this is a bit complex, so please let me know if it is not clear. Cheers, Bill ---------------------------------------------------------- Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI 53706 hibbard@xxxxxxxxxxxxxxxxx 608-263-4427 fax: 608-263-6738 http://www.ssec.wisc.edu/~billh/vis.html
visad
archives: