In want to diagnose a bottleneck which happens when my client is talking to a server on the other side of the world. I'd like to run the server on my local machine and simulate the latency. Is there a way I can inject a brief thread-sleep in all remote calls? I'm not sure which remote call is the bottleneck, so I need to delay them all.
Second attempt to clarify: I don't want to copy-paste thread sleeps into every single remote method, because there are lots and lots of remote methods. I'm trying to find a way to inject a sleep into the RMI subsystem so all calls over RMI will be delayed.