One other question about the stream handler; the javadocs say this for the StreamInvocationHandler.handleStream method's param parameter:
param - the payload associated with the invocation
What is this payload? Its type is Object so I assume it isn't the normal InvocationRequest that you get in the invoke() method. Is it similar to the InvocationRequest.getParameter() object?
If so, how do you get the invocation request metadata like the subsystem and the other things the InvocationRequest gives you (see InvocationRequest.getXXX methods)?
If sending a stream from the client the the server, the user will need to call Client.invoke(InputStream inputStream, Object param) as opposed to Client.invoke(Object param) or Client.invoke(Object param, Map metadata). This will cause remoting to internally handle the stream proxying and deliver the proxy to the handleStream(InputStream stream, Object param) method of StreamInvocationHandler.
As for the second parameter to the handleStream() method, is for any extra contextual information the client would like to send. For example, org.jboss.remoting.samples.stream.StreamingServer uses the param object to represent the file name for the stream being passed. Guess this second parameter could be of type Map, but figured would just let be of type Object so could be anything. Don't know if is maybe a little too unstructured?
Ok, so this doesn't seem right. If I don't handle streams, I can get the invocation metadata, but I CAN'T get this metadata if I'm handling streams.
Why do I get the InvocationHandler in the invoke()...
public Object invoke( InvocationRequest invocation )
...but yet I can't get that same data if the request happens to be passing streamed data:
public Object handleStream( InputStream in, Object payload )
It seems the APIs here should be similar - since they are both the integration points for receiving requests (one just happens to have a stream). I'm thinking the APIs should have been more identical:
public Object invoke(InvocationRequest invocation)
public Object handleStream(InputStream in, InvocationRequest invocation)
See what I mean?
The problem now is, if I'm getting a stream, I can't find out what subsystem my handler is in. I can't get anything related to the invocation request because the API has stripped that data from me.
Am I missing something? How can I get InvocationRequest metadata if I'm handling a stream request?
Have changed the StreamInvocationHandler interface to have:
public Object handleStream(InputStream stream, InvocationRequest param)
as its method now. See http://jira.jboss.com/jira/browse/JBREM-409 for details.