How can i get caller object by MethodEntryEvent

Hi ,
I have problem that I want to get the caller object when the program call any method. I use com.sun.jdi.MethodEntryEvent to catch the calling event but I don't know how to get the caller.
thanks for any answers.

I use
com.sun.jdi.MethodEntryEvent to catch the calling
event but I don't know how to get the caller. You have to go from the MethodEntryEvent to the Thread
and from the Thread to the active stack frame on that
thread. Then you can query the stack frame for 'this',
or for other information.
Given:
com.sun.jdi.event.MethodEntryEvent mee;
then the following will return the ObjectReference
of 'this' for the current frame:
mee.thread().frame(0).thisObject();
References:
MethodEntryEvent:
http://java.sun.com/j2se/1.4.2/docs/guide/jpda/jdi/com/sun/jdi/event/MethodEntryEvent.html
LocatableEvent
http://java.sun.com/j2se/1.4.2/docs/guide/jpda/jdi/com/sun/jdi/event/LocatableEvent.html
ThreadReference:
http://java.sun.com/j2se/1.4.2/docs/guide/jpda/jdi/com/sun/jdi/ThreadReference.html
StackFrame:
http://java.sun.com/j2se/1.4.2/docs/guide/jpda/jdi/com/sun/jdi/StackFrame.html

Similar Messages

  • How can i get session object based on session id?

    I have tried searching in forum but i can't find any solution that i can get session object based on session id and i also would like to know how to check whether the session is still active? My company currently using weblogic 5.1. I really hope that some one or anyone can help. I am new in using Servlet. I hope that i can find some answer here. Thank you.

    I have a need to get a Session object from a session id, so I don't think that the above should be deprecated. Here is my use case:
    0. I am displaying files in a file list
    1. I am downloading files.
    2. I am downloading files through a Servlet
    3. I am displaying the files as images in an applet
    4. The applet is ImageJ, and it apparently uses a full URL to download the file.
    5. I use request.getRequestURL() in the applet .jsp to get the full URL (the hostname and port)
    6. My app server is OC4J and it's behind an apache server and is host aliased.
    7. Thus the hostname is different between my applet .jsp and the Servlet URLs
    8. Thus I have 2 different sessions
    9. Thus I need to pass the session id (or some other unique identifier).
    10. I could stored the unique identifier in the application object, but then I would need to clean it up
    11. I cannot pass the the full path to the image due to security problems (what if someone downloads my password file?)
    12. I would like this to work in a clustered environment
    13. I think that WebDAV would solve my problems, since I could pass a full URL of webDAV to ImageJ for download. However, I am unsure how the security of WebDAV would work with ImageJ/URLConnection. I will have to research this feature in ImageJ.

  • How can I get schema object in entityImpl class?

    Hi everybody,
    I want to get schema object name (name of DB table behind of entity) in my entityImpl class from ADF API. I tried this But I can't.
    please help me.
    with my best regards.

    try String s = this.getEntityDef().getSource();Timo

  • How can I get the object (button) that I right clicked on?

    If I have several buttons and the user right-clicks on one of them I would like to change the color of that button. With a left click I can use evt.getSource in the actionPerformed() method but I don't see how to do that in mouseClicked().
    Thank you!

    Maybe:
    public interface MouseListener
    extends EventListener
    The listener interface for receiving "interesting" mouse events (press, release, click, enter, and exit) on a component. (To track mouse moves and mouse drags, use the MouseMotionListener.)
    The class that is interested in processing a mouse event either implements this interface (and all the methods it contains) or extends the abstract MouseAdapter class (overriding only the methods of interest).
    The listener object created from that class is then registered with a component using the component's addMouseListener method. A mouse event is generated when the mouse is pressed, released clicked (pressed and released). A mouse event is also generated when the mouse cursor enters or leaves a component. When a mouse event occurs, the relevant method in the listener object is invoked, and the MouseEvent is passed to it.
    Hope this helps - Bart

  • How can I get caller id to announce the caller from my contact list?

    My old Motorolla and LG phones had a setting to speak the caller id before ringing.  It took the names from the contact list or if not there would just call out the phone number and then go to the ringtone.  Does the Iphone 4 not have this setting?  I can't believe this "smart phone" which does just about everything would not have this function.  What am I missing here?

    I do have an iPhone 4S.  It does not provide a talking caller ID.  I too I'm surprised that such a feature is not on the iPhone.  There seems to be an "app" for just about everything, but I've yet to find one that does this very simple function.  There are some apps out there that do provide a form of caller ID, but they seem to require too much setting up for something so simple.  I do have a work a round, but it is a poor subsitute for what we are both looking for.  I have set different ringtones for some people in my contact list, so when I hear the tone, I do know who is calling.  However, if you have a great deal of contacts, this method really would not work.

  • How can I get an object to rotate around another object in Motion 5? Also, can I export on a transparent background to FCPX?

    Attempting to make one .png (its and arrow) rotate around a circlular logo which is also a .png. I need to them come out of Motion 5 for FCPX on a transpartent background. Anyone have any help for me. Stuck on this for hours now.

    Thanks Russ...
    I spend severale hours (new to Motion) trying to figure out how to set the orbit around the cicular logo. I was able to finally get it. I was missing the square under the orbit behavior that I could plug in the circular logo. lol... Once I got that set, I added to the align to motion behavior and set the drag to that behavior to get it all to rotate and work right. I then published as a generator to FCPX. After setting the background to transparent.
    Works like a charm. Just took most of my day trying to figure it out. lol.. But thats how you learn I guess.
    Thanks for the reply!

  • How can I get an object from a vector, modify it and store it back ?

    Hello all,
    I have created the clase "node", this class has a "name" property and and "counter" property, and the associated method to set the name and make the couter increase value.
    In a different class I have a vector, and I add "node" objects to this vector.
    Once I've added a few objects "nodes" I need to get one, modify the value and the store it back in. Better if it is in the same position. ..
    Thanks, alot guys. I could not copy an paste the code because I have a whole bunch of things mixed in the same code. I'd not be understanble.
    Thanks again !!

    Never mind, thanks anyway ..

  • How can I get objects of multiple instances of InDesignServer

    Hello,
    We need to have InDesignServer running in more than one configuration. And we need to script them. So to keep easy let's pretend there are 2 instances of InDesignServer running. One startet with 'indesignserver -configuration conf0' and the other started with 'indesignserver -configuration conf1'.
    So we try (Visual Basic):
    dim myIndApp0 as InDesign.Application
    dim myIndApp1 as InDesign.Application
    myIndApps0 = CreateObject("InDesignServer.Application.CS2")
    myIndApps1 = CreateObject("InDesignServer.Application.CS2")
    But both objects referring to the instance with conf0. How can we get an object of the second instance?
    We tried to solve this using System.Diagnostics.Process.GetProcesses(). So we got both processes. But did not find a way to get an object of class InDesignServer.Application by using an object of System.Diagnostics.Process. Any ideas about that way?

    Hi Ian,
    The problem is not to start different instances. In the Windows Task Manager and the console output of InDesign Server I can see, that both instances are running with different configurations. When I use Systems.Diagnostics.Processes.GetProcess() I get both processes too.
    But I don't know how to get objects of both instances using the Interop Assembly or (as a runaround) how to cast an object of System.Diagnostics.Process into an object of InDesignServer.Application.
    When you talking about SOAP, do you know how to start InDesignServer twice with diffrent ports from inside VB and getting the InDesignServer.Application objects of it?
    This should be solve our problem too.

  • How can I get a count of objects in the near cache? (Extend client)

    Hi,
    I'm trying to figure out how to get the count of objects in my near cache (from c++ client). Knowing the size of the near cache is a key factor when optimizing configurations for performance.
    However if I call size() on the cache handle I get the count of objects in the cache (ie the cluster). How can I get a count of objects in the near cache?
    Thanks
    Rich Carless

    H Rich,
    It may not be ideal, but I think you may be able to infer the size by using the HeapAnalyzer (http://download.oracle.com/docs/cd/E15357_01/coh.360/e15728/classcoherence_1_1lang_1_1_heap_analyzer.html) facility, specifically the "class" based HeapAnalyzer. Its Snapshot representation http://download.oracle.com/docs/cd/E15357_01/coh.360/e15728/classcoherence_1_1lang_1_1_class_based_heap_analyzer_1_1_snapshot.html provides a mapping between class name and ClassStats (http://download.oracle.com/docs/cd/E15357_01/coh.360/e15728/classcoherence_1_1lang_1_1_class_based_heap_analyzer_1_1_class_stats.html) which provides information on how many instances of a given class type are in memory. Note the reported counts are process wide but if your key or value type are distinct you may be able to infer your answer. I realize this is rather complex, my only other suggestion would be to just make some guesses on size and see how they effect performance.
    Mark
    Oracle Coherence

  • How to get caller object reference from a method

    Hi,
    I am working a already existing Java Swing project, now I got a problem, in a method I need to get the caller object reference otherwise, I can't succeed this operation. So please tell me a way how to get the caller object reference from a method. that method would be static or regular method anything will do for me.
    Edited by: navaneeth.j on Jan 29, 2010 11:20 PM

    navaneeth.j wrote:
    Actually my doubt is, I have a method "addition" method, which is using by many classes so my requirement is in the addition method I want to write a code snippet which will identify and get the the caller object. Actually I tried Reflection.getcallerclass but there I am getting "CLASS" object not the actual object reference, but I want object reference.
    Actually we have a huge project which is writen plain JAVA, so in this project the authors written the Database connection package for single database transaction. so now we are using this project source code for JSF application in this web application the DB package has serve based on the dynamic db connection parameters, so if we want to change this package fully means need to solve the dependency problem in hundreds of classes, so my point is if I can access the caller object in the DB package when ever it gets called by any class from any where of the project. So actually I liked Reflection.getcallerclass, the way of implementation perfectly works for me but it is not giving caller object reference, if something gives the caller object then I can get the DB connection parameters then there is no need to pass the parameters in the hierarchy.You can add a parameter (of type Object) to your addition() method
    and everywhere you call the addition() method also pass this (which from the POW of the addition() method will be a reference to the calling class instance).
    There may be alternative solutions
    but none that require less effort.

  • How can I get the underlying object from the ObjectReference

    Dear friends,
    I think this question has been asked a couple of times. But, I am still wondering if anybody has found an answer to it. Maybe this is some common need ...
    I would like to get the underlying object for which the ObjectReference is
    a mirror For example, I have a class Customer in my application, and I can get an ObjectReference through JDI during runtime. But how can I get the target VM's object which is a real instance of Customer, by which I can invoke methods defined in Customer?
    Thank you so much for any input!
    SunnyDay

    I'll preface this response by admitting this far from an elegant solution, but I did write a function addressing this question, mostly as an exercise.
    If passed an object with an InTextFrame property (Pgf, AFrame, Cell, Fn) that resides in an open document, the function will return the Doc object. Otherwise, it returns undefined.
    function getParentDoc(testObj) {
        //Get object for current page
        try { var curPage = testObj.InTextFrame.FrameParent.PageFramePage; }
        catch(er) {return;}
        //Step backwards to first page in document
        var prevPage = curPage.PagePrev;
        while (prevPage.ObjectValid())
            curPage = prevPage;
            prevPage = prevPage.PagePrev;
        //Compare with first pages of open documents
        var testDoc = app.FirstOpenDoc;
        while (testDoc.ObjectValid())
            if (curPage.id==testDoc.FirstBodyPageInDoc.id) return testDoc;
            testDoc = testDoc.NextOpenDocInSession;    
        return;
    To your PPS: Rather than seeing the native framework grow bloated to address additional features, I would love to see Adobe and other developers publish libraries of useful functions and class extensions.

  • My iPod Classic is seen by Windows but not by iTunes.  I have reset it, gone to disk mode and it won't show up in iTunes.  There appears to be music on it in a file called MUSICSAVE.  How can I get this to work with iTunes again?

    My iPod Classic is seen by Windows but not by iTunes.  I have reset it, gone to disk mode and it won't show up in iTunes.  There appears to be music on it in a file called MUSICSAVE.  How can I get this to work with iTunes again?

    1. Update iTunes to the latest version. Plug in your iPod. If iTunes still can't recognize it, then in iTunes in the top left corner click help> run diagnostics. On the box that comes up, check the last two things. Click next and it should identify your iPod.
    2. Click on your windows start menu. Type in "services". Click on it and when it pops up, on the bottom of it click on "standard". Now Scroll down to find "Apple Mobile Device" Right click it when you see it and click on "Start". When it has started, close iTunes and replug in your iPod and it should show up.
    3. Check the USB cable
    4 Verify that Apple Mobile Device Support is installed
    5. Restart the Apple Mobile Device Service and verify that the Apple Mobile Device USB Driver is installed.
    6. If you just want to add some photos, songs and movies from computer to your devices, you can use an iTunes alternative to do the job
    7. Check for third-party software conflicts.
    <Link Edited By Host>

  • When I am home, calls to my iPhone 5 also go to my other family members' iPhones.  How can I get this to stop happening?

    When I am home, calls to my iPhone 5 also go to my other family members' iPhones.  How  can I get this to stop happening?

    Or better yet, create and use new Apple IDs for others in your household. You could always use different Apple IDs for iCloud services (like iMessage and FaceTime) and iTunes and App Store., but it's even easier to share purchased content now with Family Sharing.

  • How can I get my iphone4 in siri to call me by my name

    How can I get my iPhone 4s siri to call me by my first name

    Just say to Siri "call me Robert" (or whatever you want).

  • How can i get the unitOfWork or the persisting object in to my listener???.

    hi,
    i have a listener class which extends SessionEventAdapter ....as shown below
    public class MyLister extends SessionEventAdapter{
    public void postCommitUnitOfWork(SessionEvent event) {
    System.out.println("POST COMMIT OF WORK");
    // How can i get the unitOfWork or the persisting object in to my listener???
    Another class makes use of this listener by adding the listener into a getEventManager() of a session ....
    public final class AetbProcessStatusClient {
    public static final void main(String[] args)
    {  Project project =   
    XMLProjectReader.read("META- INF/AetbProcessStatus.xml",
    Thread.currentThread().getContextClassLoader());
    DatabaseSession session = project.createDatabaseSession();
    MyLister myListener = new MyLister();
    session.getEventManager().addListener(myListener);
    session.login();
    UnitOfWork uow = session.acquireUnitOfWork();
    uow = session.acquireUnitOfWork();
    Vector vec =
    (Vector)uow.executeQuery("SQFunctionIdProcessStatus", AetbProcessStatus.class);
    AetbProcessStatus processStatus = new AetbProcessStatus();
    processStatus = (AetbProcessStatus)vec.get(0);
    processStatus.setRunStat('E');
    processStatus.setProgramSeqNo(10);
    uow.commit();
    now my question --> How can i get the unitOfWork or the persisting object in to my listener???....
    ie the object "processStatus" into my listener

    The SessionEvent's session (getSession()), should be the UnitOfWork. You can access the UnitOfWork or UnitOfWorkImpl methods to access the objects in the unit of work. getUnitOfWorkChangeSet() will return the changes made in the UnitOfWork.
    -- James : http://www.eclipselink.org

Maybe you are looking for

  • Password protection to PDF file in SAP

    Hi All, Need a help from ABAPer, we have a tax projection sheet which is mailed to every employee based on his Email ID maintained in IT - 0105 (Communications). However, thre was a small bug in the report due to which the Tax sheet was mailed to wro

  • Connect apple tv to time capsule with ethernet?

    How do you connect apple tv to time capsule with ethernet?

  • PCB Board Size

    How can you change the dimensions of the board itself?  I transfered a schematic from Multisim to Ultiboard and it gave me some default board outline size.  I want to change this because I can fit all my components in a much smaller board.  I tried t

  • Can't click back button in Safari on Iphone

    I'm not sure at which update this began, but I recently realized I can't use the back button in Safari. It just stays dimmed, when normally once you navigate to a new page it illuminates and then you can use it to go back. This is very annoying. Any

  • ISight on MacBook 2009 constantly on

    Hello and thanks in advance for any advice anyone can offer. My 2009 MacBook has suddenly developed an odd fault: since the automatic software update, the iSight built-in camera is on and I can't seem to be able to turn it off. I have tried: - shutti