You can get the current
thread and dump the stack trace to see where you are:
Of course the "answer" is displayed in standard out. But you could re-assign "System.out" to some file, then do the ".dumpStack()", close the file and then read the results and parse them to figure out where you came from.
Not easy, but doable if you are desparate. I haven't looked at the SecurityManager so I can't speak to that solution.