• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in Reflection

 
Thennam Pandian
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How can I find the Calling Methos using reflection.


thanks,
Thennam
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think that is done via reflection. Look at the Thread class, for how to get the stack trace.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean you have a method which wants to know which method has invoked it?

I don't think that you are actually supposed to do that; the idea of a supplier class with public methods is that it is available to all objects without prejudice and without knowing whom it is serving. Bit like a bus; anybody can travel as long as they pay for their ticket, without the driver asking their name!
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic