|
From: Vladimir B. <vla...@cs...> - 2004-02-23 15:39:50
|
Hi, I posted this question on help forum but maybe this list is a more appropriate venue for the discussion. It seems that there is no current built-in API to specify additional invocation parameters. Here is why. RemoteInvocationWrapper is an object that accepts remote calls and tunnels them to a wrapped service object. RemoteInvocationWrapper is bound to Registry and has a specific signature - public Object invokeRemote(String methodName, Class[] paramTypes, Object[] params) - that is matched by RemoteInvocationHandler. RemoteInvocationhandler on a client side is in turn wrapped by RmiClientInterceptor which directs calls from client intereface to the RemoteInvocationHandler. Very nice, except that invokeRemote signature. I remember that in Jboss days the problem of additional invocation parameters was solved by an abstract Invocation interface that had a couple of predefined properties (method,paramTypes, params)as well as a map for custom properties. So instead of the above mentioned method signature you would pass a more abstract Invocation object from client to server. Then you can add custom interceptors on both client and server and customize invocation with additional parameters. For example, a client interceptor prior to marshalling invocation could strap on user's Principal and a server interceptor could access that principal in a matching interceptor on the server? Any comments? Regards, Vladimir |