Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > find out wich class have colled method at run time

Reply
Thread Tools

find out wich class have colled method at run time

 
 
Carramba
Guest
Posts: n/a
 
      10-05-2006

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
'<
 
Reply With Quote
 
 
 
 
Simon
Guest
Posts: n/a
 
      10-05-2006
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why a class can't access protected method from another class in thesame package,the method is interited from the ohtner class from differntpackage? junzhang1983@gmail.com Java 3 01-28-2008 02:09 AM
Run-time template list definition / Run-time variable type definition Pierre Yves C++ 2 01-10-2008 02:52 PM
Warehouse Dell dimension 3000 advert. This is a question so TNO doesn't have to download this message and read it to waste his time reading messages that I could have possibly got the answer .. (damn, run out of space in the subject line!) cowboyz NZ Computing 68 12-21-2004 02:19 PM
retrieve the element wich have the focus Cui Javascript 3 04-07-2004 12:26 PM
Any good and free program design tool out there? (wich preferably support the top down method) Kent C Programming 1 09-26-2003 11:54 AM



Advertisments