added getCurrentRequestEvaluator hook for benchmarking

and debugging.
This commit is contained in:
hns 2002-06-07 19:51:11 +00:00
parent e5dcf80f84
commit 63b7cb78c3

View file

@ -859,8 +859,19 @@ public final class Application extends UnicastRemoteObject implements IRemoteApp
return debug; return debug;
} }
public RequestEvaluator getCurrentRequestEvaluator () {
Thread thread = Thread.currentThread ();
int l = allThreads.size();
for (int i=0; i<l; i++) {
RequestEvaluator r = (RequestEvaluator) allThreads.get (i);
if (r != null && r.rtx == thread)
return r;
}
return null;
}
/** /**
* Utiliti function invoker for the methods below. This *must* be called * Utility function invoker for the methods below. This *must* be called
* by an active RequestEvaluator thread. * by an active RequestEvaluator thread.
*/ */
private Object invokeFunction (Object obj, String func, Object[] args) { private Object invokeFunction (Object obj, String func, Object[] args) {