Caspar, Ben
I once implemented such a progress monitor. As Ben says, all you need to
do is write the serialized data to a byte array and then only send the
byte array. The servlet container will take care of the rest, set the
content-length
header and then you need to intercept the input in the HessianProxy
to monitor the incoming bytes.
This is especially helpful if communication lines can be slow like
for mobile
connections where Hessian is extremly useful since it has a reduced
footprint
compared to SOAP.
It does however require that you make modifications to HessianProxy
and HessianServlet
(or you subclass them, or write your own implementation).
We also use it to send Java Objects with embedded Binary Attachments.
Showing
a progress can become an issue.
- Christian
Am 16.08.2007 um 08:31 schrieb Ben Hood:
Caspar,
AFAIK the java implementation of Hessian encodes in a streaming
fashion so you don't know when you start encoding the response how
large the encoded payload will be.
I think this would require you to do a double pass when encoding the
response, e.g. encode the response to a byte array, whose length you
can count, and then re-encode the same data setting a header in the
response to indicate the length. There are obviously various other
hacks you could do to save encoding everything twice (i.e. to add the
length to an encoded piece of data), but that's up to your
imagination.
BTW, what are sending that is so large that it requires the overhead
of a progress status?
HTH,
Ben
On 8/16/07, Casper Bang <[EMAIL PROTECTED]> wrote:
I only recently learned about Hessian, after developing my own
HttpServlet <-> UrlConnection binary service framework. I would
like to
use Hessian but I am missing one feature. In my framework, I place
the
size of the serialized data in the Content-Length header of a
response,
such as to allow for progress bar to be updated accordingly on a
client.
Is there a similar approach for monitoring the transfer in
Hessian, or
is it strictly a blocking proxy?
Regards,
Casper
_______________________________________________
hessian-interest mailing list
[email protected]
http://maillist.caucho.com/mailman/listinfo/hessian-interest
_______________________________________________
hessian-interest mailing list
[email protected]
http://maillist.caucho.com/mailman/listinfo/hessian-interest
Christian Campo
([EMAIL PROTECTED])
_______________________________________________
hessian-interest mailing list
[email protected]
http://maillist.caucho.com/mailman/listinfo/hessian-interest