It is possible, but it is expensive and somewhat remotely similar to a normal case, it is a very bad idea. You almost certainly want to approach a problem that you solve differently. (And if you post a new question about the problem that you are solving, I bet that someone will help you with this! :-))
Two ways to create a stack trace:
1) Via Throwable
... by throwing and catching an exception, and then using Exception#getStackTrace
try { throw new Exception(); } catch (Exception e) {
... or as lscoughlin points out (please vote for it), more directly , just new Throwable :
StackTraceElement[] entries = new Throwable().getStackTrace();
Each of these StackTraceElement s then provides you with information about this point in the stack trace. In your case, you probably want to look at the StackTraceElement getClassName . If you really need a reference to the object of the calling class, you can pass this string to the class name in Class.forName , but warn that in complex environments, you can get another instance (or not an instance) of the class if the calling user did interesting things with the loaders classes.
MRalwasser cautiously points out below that in Java 5 or higher (and I assume you are probably using Java 5 or higher), you can use Thread.currentThread().getStackTrace() instead of actually throwing an exception. I don't know if it will be easier or not (since getting a stack trace can be so expensive that it throws an exception), but it is definitely cleaner.
In a quick and dirty test, counter-intuitively actually throwing an exception seemed faster than through Thread (and pretty much the same as new Throwable ), but the vagaries of naive profiling of JVM applications are well documented, your mileage may vary ...
But then again, not only does the stack trace be an expensive process, but using caller information that the caller did not pass to you through the method signature is a serious design problem in anything other than (say) a debugger or an error used only for development . The main answer here should be: do not do this unless you have a really good reason.