Scott Ferguson wrote (2007-10-30 17:23):
> On Oct 30, 2007, at 8:54 AM, Mattias Jiderhamn wrote:
>
>   
>>> I have been thinking of adding javax.activation.DataSource  
>>> capability to Hessian.  It's easy to handle on the sending side,  
>>> but I'm not sure how to handle it properly on the receiving side.
>>>
>>>       
>> (I don't quite see how this relates to my situation)
>>     
>
> You might be able to send a bunch of files all at once by serializing the 
> following structure:
>
>    DataSource []fileList
>
> Hessian would open each data source and serialize it.  The other side is 
> trickier.  In theory, it would deserialize the data as it becomes  
> available.
I guess one might argue that whether the actual "contents" should be
serialized, could depend on the implementation. For example, a
URLDataSource may quite possibly be transparently transferred between
different machines (assuming the Hessian request does not pass through
any firewalls blocking the URL at the receiving end, that is). But in
the case of a FileDataSource the actual contents of the file would have
to be transferred, too (unless, as in my case, both client and server
reside on the same machine).

> The question is where should Hessian deserialize the data to?  It should 
> really ask the application for a target DataSource, so the application could 
> select a temporary storage method.
>   
Yes, that could be useful.
In our case we have created a TempFile class, that creates a file in the
OS temp directory, that is deleted when the object is finalize()'d. I
guess something like that would work in your case.


I also had another idea for my problem at hand. I could possibly
transfer all Java structures using sessionless Hessian/SOAP/RMI/whatever
and then have the server/receiver make callback requests and ask a plain
old servlet for the binary data, identified by parameters from the
initial request.
I believe that in theory it would work, but I'm afraid it might be a bit
unstable in reality. I have a hunch you might run into rather strange
deadlocks.

 /Mattias
_______________________________________________
hessian-interest mailing list
[email protected]
http://maillist.caucho.com/mailman/listinfo/hessian-interest

Reply via email to