find out wich class have colled method at run time

Discussion in 'Java' started by Carramba, Oct 5, 2006.

  1. Carramba

    Carramba Guest

    hello
    If I have one class with some public method, is there a way to find out
    wich class have called it, and do it at runtime?
    I can't modie classes that a using this method.


    Thanx in advance
    '<
    Carramba, Oct 5, 2006
    #1
    1. Advertising

  2. Carramba

    Simon Guest

    Carramba wrote:
    > If I have one class with some public method, is there a way to find out
    > wich class have called it, and do it at runtime?
    > I can't modie classes that a using this method.


    You can try to construct an exception, fill in the stack trace and find the
    respective entry in the array of StackTraceElements.

    Cheers,
    Simon
    Simon, Oct 5, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bredal Jensen

    Identify wich button was pressed!

    bredal Jensen, Jul 15, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    526
    bredal Jensen
    Jul 16, 2004
  2. Fabiano
    Replies:
    1
    Views:
    522
  3. Tjerk Wolterink
    Replies:
    9
    Views:
    1,221
    Joris Gillis
    Feb 7, 2005
  4. Kent
    Replies:
    1
    Views:
    389
    Irrwahn Grausewitz
    Sep 26, 2003
  5. Cui
    Replies:
    3
    Views:
    94
Loading...

Share This Page