INNER CODE UNIT · Java
invoke
RuedigerMoeller/kontraktor · attic/ElasticScheduler.java:255
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if ( method.getDeclaringClass() == Object.class )
return method.invoke(proxy,args); // toString, hashCode etc. invoke sync (DANGER if hashcode accesses mutable local state)
if ( target != null ) {
CallEntry ce = new CallEntry(target,method,args, Actor.sender.get(), targetActor, true);
put2QueuePolling(targetActor.__cbQueue, true, ce, targetActor);
}
return null;
}
}
@Override
public InvocationHandler getInvoker(Actor dispatcher, Object toWrap) {
return new CallbackInvokeHandler(toWrap, dispatcher);
}
/**
* Creates a wrapper on the given object enqueuing all calls to INTERFACE methods of the given object to the given actors's queue.