How to obtain a caller object reference from within a called method?
I have to execute a given String as JavaScript code, e.g. eval('Foo.setMessage("Hello!")'), from within a class called Engine. Here, setMessage() is a public static method of the Foo class. Because I want to access some properties of the Engine object from within the setMessage() method, how can I obtain a reference to the MyApp object?
I do know how to get the caller class name using Reflection or StackTrace or Throwable, but these do not return a caller object reference.
Please help, thanks,
John