net.sourceforge.hiveremoting.caucho
Interface RemoteContextHandler


public interface RemoteContextHandler

Interface enabling hiveremoting.caucho users to add and analyse context information to the actual Caucho payload. Developers must provide a class that implement this interface and pass an instance of their class to the hiveremoting.caucho.RemoteServices configuration-point (for server side) and to hiveremoting.caucho.CauchoProxyFactory (for client side).

Please note that the actual way to pass this extra information is not compatible with other Hession/Burlap implementations (it does not use Hessian/Burlap headers, but prefer http headers instead). This may change in a future version of hiveremoting.caucho (to bring higher interoperability).

Author:
Jean-Francois Poilpret

Method Summary
 void extractContext(java.util.Map<java.lang.String,java.lang.String> context)
          Called just after a Caucho message is received through the wire.
 void initContext(java.util.Map<java.lang.String,java.lang.String> context)
          Called just before a Caucho message is sent through the wire.
 

Method Detail

initContext

void initContext(java.util.Map<java.lang.String,java.lang.String> context)
Called just before a Caucho message is sent through the wire. For client side, that is just before the remote method is called, for server side, that is just after the remote service has been actually invoked, and before its result is sent back to the client.

This method is used to add context to the payload.

Parameters:
context - a map to which specific context can be added. Note that only String values are accepted (any non String value will be silently dismissed).

extractContext

void extractContext(java.util.Map<java.lang.String,java.lang.String> context)
Called just after a Caucho message is received through the wire. For client side, that is just after the remote method result has been received, before that result is returned to the caller, for server side, that is just before the remote service is actually invoked.

This method is used to extract context from the payload in order to, ie, check it.

Parameters:
context - a map containing the specific context that was present in the payload.