OK, I (only partly) answer my own questions...
1. NO, hessian java does not support hessian headers as specified in hessian
1.0.1 specification :-(
2. It is not possible with current hessian-3.0.13.jar to even implement it
by myself :-(
Let me explain:
I have been analysing HessianInput and HessianOutput for a few hours. I have
reached the following conclusions:
- it is possible (and easy:-)) to extend HessianOutput to set headers from
eg, a Map (if someone wants the code, I can send him)
- it is NOT possible to extend HessianInput to retrieve headers back into a
Map :-( Indeed, some methods in HessianInput are private and prevent such an
extension. For example, I need to extend readReply() to add my own code to
read (and store) headers. readReply is public, OK, so should be easy to
extend... However, adding my code to it implies copy/pasting the original
code (sorry, I too hate copy/paste...) as follows:
public Object readReply(Class expectedClass) throws Throwable
{
int tag = read();
if (tag != 'r')
error("expected hessian reply");
int major = read();
int minor = read();
readHeaders(); // <<<< My added code >>>>
tag = read();
if (tag == 'f')
throw prepareFault(); // <<<< Problem >>>>
else
{
_peek = tag;
Object value = readObject(expectedClass);
completeValueReply();
return value;
}
}
The problem here is that HessianInput's prepareFault() is private!
So please, Scott Ferguson, can you help me?
Either by making this prepareFault() method protected, or better by directly
adding header support in hessian.jar (I can send you my coding attempts if
you like, they are quite simple and could be easily integrated to the
current HessianInput/HessianOutput).
Of course, I could also patch directly hessian jar and redistribute my own
version along with my jars, but I had rather avoid doing that, for obvious
reasons.
Best regards,
Jean-Francois Poilpret, HiveMind Utilities team
-----Original Message-----
From: owner-hessian-interest@xxx.com
[mailto:owner-hessian-interest@xxx.com] On Behalf Of Jean-Francois
Poilpret
Sent: Wednesday, August 24, 2005 11:11 PM
To: hessian-interest@xxx.com
Subject: Hessian headers and Java
Hello,
Does hessian java support hessian headers (as defined hessian 1.0.1
specification?
If yes, how to use such headers? Both in client and server side.
If no, can someone point me to some directions I should follow to implement
it by myself?
Thanks in advance
Cheers
Jean-Francois
Received on Thu 25 Aug 2005 09:56:24 -0700
This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:16:41 PDT