You think about the correct lines, it just needs to be specified. Pick yourself up, I'm going to hit you with a bunch of long class names ...
Client Side factory, which creates a plug, which is talking to the remote service HttpInvokerProxyFactoryBean. The superclass ( HttpInvokerClientInterceptor) has a property called httpInvokerRequestExecutor, which by default corresponds to the instance SimpleHttpInvokerRequestExecutor.
It is ripe for subclass and expansion; in particular, it has a method decorateInputStreamthat you can use:
public class CountingHttpInvokerRequestExecutor extends SimpleHttpInvokerRequestExecutor {
@Override
protected InputStream decorateInputStream(InputStream is) throws IOException {
return new CountingInputStream(super.decorateInputStream(is));
}
}
And then enter this in the proxy factory:
<bean class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="httpInvokerRequestExecutor">
<bean class="com.mycompany.CountingHttpInvokerRequestExecutor"/>
</property>
</bean>
Then the trick becomes available for this information, which will require some creative rewriting. For example, you can get new instances CountingInputStreamfrom another factory, which then displays the number of bytes in your user interface.