Hessian and JMX Remoting (JSR 160)

From: Bordet, Simone <simone.bordet@xxx.com>
Date: Sat Jul 24 2004 - 14:16:31 PDT

Hi,

the MX4J project (http://mx4j.sf.net) is exploring the possibility to use Hessian/Burlap to implement a JSR 160 provider.
A JSR 160 provider is a JMXConnector/JMXConnectorServer pair that allows a client to connect to a remote MBeanServer.

The JSR 160 specification defines 2 standard providers (one is based on RMI), and also a standard way to plug in providers that use different protocol, such as Hessian.

Several clients (JMXConnectors) may connect to a single server (JMXConnectorServer), and each client has the notion of its connection ID. The server side must be able to distinguish on from another the clients that connect to it (among various reasons, security).

Hessian works in a way that a single servlet is deployed, and a single server-side pojo is the invocation target (the service).
The connection ID must then either be part of the signature of all the methods of the service, or be passed transparently in each call. I have to say that I like more the second option than the first.

Fortunately, the Hessian protocol allows headers to be passed in a call (http://caucho.com/resin-3.0/protocols/hessian-1.0-spec.xtp).

Unfortunately, nor HessianOutput nor HessianServlet/HessianSkeleton have working support for headers.

It seems to me that HessianOutput.startCall(String) does not allow to write a header *before* writing the method name, as the protocol requires: a bug ?
Also, HessianSkeleton does not read headers, and I could not find any mechanism to pass headers to the service, such as:

public interface HessianHeadersAware
{
   public void setHessianHeaders(Map headers);
}

Passing the connection ID as a String in the URL may work, but I'd like to use this option as last resort since connection IDs are easily guessable. Furthermore, there may be the need to pass more complex objects than a simple string.

Finally, hacking a lot, I've been able to have a working implementation :)

However I feel my hacks would instead be better placed in an improved HessianOutput and HessianServlet than in MX4J code, to better support headers. However, I'm not very familiar with the uses of Hessian in other contexts (such as the EJB world) so I think a detailed discussion with Hessian specialists may be the next step, if there is interest.

Regards,

Simon
Received on Sat 24 Jul 2004 14:16:31 -0700

This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:16:40 PDT