Knowing the identity of the calling application.

I have a static object which can be shared between two applications, similar to a static object that can be shared between two applets. Now if the object has a method say myMethod() how can i know which application called the method. To be more clear.
Let my object be MyObject.
Now the static instance for the object would be
static MyObject myObject = new MyObject().
I have two applets appletA and appletB;
Suppose appletA or appletB were to call myObject.myMethod(), how will i know that appletA called the method or appletB called the method.
I need to know this for applications not applets if there is a difference in solution for both.
Any help would be really very useful.
Thanks
Rishab

Actually there is more to the problem. I have a static object reference in myClass. Okay now when ever the application calls myObject.myMethod() i need to update the reference to the calling application. I cannot change the method signature of myMethod() to pass the reference of the calling application, because this will be called by someone else. Also i forgot to write this , myMethod is a static method. So the only way this can be called are in the following ways.
class myApplication {
myApplication() {
myObject.myMethod();
myApplication b = new myApplication();
myApplication c = new myApplication();
Now in myMethod i need to know the following
static void myMethod() {
// Caller myApplication b or myApplication C ????
I am not sure how to use, this but the Security Packages have some way to do this i think.
I have tried the following, using two applets.
System.getRuntime() in myApplet 1 or myApplet 2 returns the same object, so no use.
The class loader used for both the applets is the system class loader so no use.
One question, taking the case of two applets, they are running on the same browser VM. But wouldnt they be running in two different threads. The currentThread for both still is the same.
RMI is out of question, cause i am not supposed to use the RMI package.
Thanks for the help so far.
regards,
Rishab

Similar Messages

  • How to get back to the calling application ?

    Hi Friends ,
                I am having a BSP application which is being called from different Planning layouts in BPS .
      Its a stateful application and I am finding that when i hit standard browser Back button i am returning to my application again .
      I tried creating a button and passing the javascript method history.back()
    <htmlb:button id       = "BACK"
                                onClick  = "BACK"
                                text     = "BACK"
                                tooltip  = "Back"
                           disabled = "<%= v_save_disable %>"
                           onClientClick="history.back();"
                                width    = "15" />
    it is notworking.
    Please let me know how can i resolve the issue ? I have another idea to divert the user to the calling application using URL but dont know how to capture the URL of calling application ?
    i appreciate your contribution in advance.

    <i>It generates a BSP in which i am adding a URL link to call my application.</i>
    while adding the url add a parameter to it masterdatabsp.htm?frompage=<currentpagename>
    (runtime->PAGE_NAME will return current page name)
    and in the master data maintenance bsp page declare a page attribute and name it frompage type string and check the auto check box.
    now within your masterdatamanintenance bsp you will have the calling page name.
    Hope this is clear. if not do getback.
    Regards
    Raja
    i work in a place where weekends are on thursdays and fridays - today is a working day

  • Controlling WDJ behaviour based on the Calling Application - Any Idea?

    Hi Folks,
    I have crated <u>two applications</u> to call the <u>one WDJ program</u>.. So that based on the calling application i need to change the behavior of the WDJ program.. that is displlay and not to display few UI elements based on the calling application..
    Can sone one pelase help me in this regards
    Thanks in advance,
    Srini.

    Hi Srinivas,
    please, follow these steps:
    1) in the url of your application send a parameter (e.g. 'a' for application 1 and 'b' for application 2).
    2) Into web dynpro create an inbound Plugs(Open your Interface View -> Plugs) as:
    Name : Default
    Event Handler: onPlugDefault
    Startup: yes
    This plug will read the value you sent in the URL.
    3) Assign to it a parameter in the Parameters Area, i.e. "param1" type string
    4) In the View you can capture the parameter value in the URL in the wdDoInit method, using this code:
    String par1 = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("param1");
    5) Note that in the View you must add the interface (Properties -> Required Controllers)
    That's all. Hoper this help you.
    Regards,
    Vito

  • Can we know the call was BAPI or else?

    Hello friends,
    I have a requirement to create PO.
    I want to create it with online session (Not in a BAPI call, BDC or a background job)
    I can check the logic for BDC --> SY-BINPT and Backgrond job -->SY-BATCH.
    But anybody can tell me how would I know the call is in BAPI??
    Regards,
    Ronny

    Find BAPI in BAPI transaction

  • How can I know the web application name of a report?

    Hi forum,
    I have a query that is used by web. I need to know the name and how to access to application web of report
    any idea
    thanks in advance

    Hi,
    If you know the Query name,you can get name of the webtemplate from metadata repository.
    go to RSA1>MetadataRepository>click 'Query'>it will display all the Queries>search for your Query (cntrl+F)-->cliclk on it. You can see the Workbooks,webtemplate,chars,kfs...etc which are related to this Query.
    thanks

  • Can I know the caller method from callee

    Hi,
    I have a method which is called from multiple methods. Is it possible to know the method which called it wihtout sending the parameter to specify which method called it. i.e. without using something like send 1 for method 2 for other.
    One way I thnk is build an exception. Throw & catch it in the same method & get the stackTrace();

    I would respectfully remark that it isn't your
    method's job to police the callers. It still
    shouldn't be concerned with who the caller
    was. It should just throw an appropriate exception
    indicating invalid parameters were passed. Then it's
    the caller's responsiblity to do something about it.Yeah... that is why exceptions exist. Throw an IlegalArgumentException and then (since it's unchecked) if you want to watch out for it, watch for it in the calling method, which is after all the method in charge.
    It is easy to get carried away with the "spot checking" philosophy and try to handle all errors exactly where they occur, but if you think about it, where did the error really occur? Up the stack at the caller.. that is where the bad arguments came from.
    Also, strictly speaking, it should be a rare case when code throws an IllegalArgumentException. For the most part exceptions should represent just that - exceptions. It is not really in best form for them to be used as conditionals.
    For example, instead of getting input from the user and then forcing it down the method's throat without checks, you should run your own checks on it first - for example, by telling the JTextField that it is not allowed to accept characters that would result in an IllegalArgumentException.
    Exceptions should represent just that; hence, except for certain weird cases, a body of classes that you write that interact exclusively with each other should be designed to (almost) never throw exceptions.
    When someone else starts using your classes, all bets are off.
    Drake

  • Can I know the caller number on M127fn printer screen?

    Hello, I configured my fax in printer m127fn to receive both voice calls and fax transmissions (Fax/Tel). When someone is calling, the printer screen show this message (Incoming voice call, Pick up headset) without showing the caller number whether on printer screen or the phone screen itself. My question is can I configure the printer to show up the number of the voice caller? Thank you.

    Hey @MI99,
    Welcome to the HP Support Forums!
    I understand that you would like your HP LaserJet Pro MFP M127fn to display the phone number of who is calling on the display of the printer, rather than just showing 'Incoming Voice call, Pick Up Headset'. This option should work just fine if you subscribe to a Caller ID service from your phone company. As long as you have that Caller ID service on the phone line that the fax and phone share than your HP Laserjet fax machine should display the phone numbers much like a telephone would.
    Please let me know if this clears up any confusion.  Have a nice day!
    X-23
    I work on behalf of HP
    Please click "Accept as Solution" if you feel my post solved your issue, it will help others find the solution.
    Click the "Kudos, Thumbs Up" on the right to say "Thanks" for helping!

  • Web service that streams a clob to the calling application

    I need to produce a web service that streams a clob to a calling application: what I have currently is a web service that contains calls to htp, thinking this would serve as a way for a user to download a clob from the procedure that the web service is based on (see Trouble calling htp in a web service procedure
    I can't get that approach to work at all, so rather than repeatedly bang my head against the wall I'll raise the following question: is there a standard approach whereby a clob can be streamed to the application consuming the web service? Note that I have limited myself in that I'm consuming the WS using APEX - APEX would like to store a returned value from a FUNCTION web service in a page item or a collection, but I will need to be returning very large CLOBs at times, so this is not an option.
    I'm sure there must be examples of web services being used to return large streams of data returned by stored procedures but I can't seem to find them Could anyone point me in the right direction?

    Ok, I've had to change tack. I've now recreated the web service and have handled the large CLOB as a streaming attachment: this performs well when running the test in Enterprise Manager as it returns a big CLOB very quickly. My problem is consuming this big SOAP message. I have tried calling this web service from a PLSQL procedure shown below but I get the following error:
    ORA-29541: class XMLDBMASTER.oracle/jpub/runtime/dbws/DbwsProxy could not be resolved
    When testing the WS there is obviously a automatically generated stub that will handle the returned SOAP message and it's streaming attachment. How is calling this from a DB procedure different, must I supply a proxy to the procedure manually?
    Please, if anyone has any clue could they give me a shout? (Procedure below)
    PROCEDURE run_ws (p_resid IN VARCHAR2,p_filename VARCHAR2, p_filter_str IN VARCHAR2)
    AS
    l_service UTL_DBWS.service;
    l_call UTL_DBWS.call;
    l_result ANYDATA;
    l_wsdl_url VARCHAR2(1024);
    l_service_name VARCHAR2(200);
    l_operation_name VARCHAR2(200);
    l_input_params UTL_DBWS.anydata_list;
    v_mime VARCHAR2 (48) := NULL;
    v_length NUMBER;
    v_clob CLOB;
    v_file_name VARCHAR2 (2000);
    v_buf VARCHAR2 (32000);
    v_amt NUMBER := 4000;
    v_pos NUMBER := 1;
    BEGIN
    l_wsdl_url := 'http://ltp003357.sepanet.sepa.org.uk:8888/getXMLclob/getXMLclob';
    l_service_name := 'getXMLclob';
    l_operation_name := 'getClob';
    l_service := UTL_DBWS.create_service (
    wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
    service_name => l_service_name);
    l_call := UTL_DBWS.create_call (
    service_handle => l_service,
    port_name => NULL,
    operation_name => l_operation_name);
    l_input_params(1) := ANYDATA.ConvertVarchar2(p_resid);
    l_input_params(2) := ANYDATA.ConvertVarchar2(p_filename);
    l_input_params(3) := ANYDATA.ConvertVarchar2(p_filter_str);
    l_result := UTL_DBWS.invoke (
    call_handle => l_call,
    input_params => l_input_params);
    UTL_DBWS.release_call (call_handle => l_call);
    UTL_DBWS.release_service (service_handle => l_service);
    v_clob:=ANYDATA.AccessClob(l_result);
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Content-length: ' || v_length);
    HTP.p ('Content-Disposition: attachment; filename="' || NVL('user_test','user_query.xml') || '"');
    OWA_UTIL.http_header_close;
    BEGIN
    v_pos := 1;
    LOOP
    DBMS_LOB.READ (v_clob
    , v_amt
    , v_pos
    , v_buf
    v_pos := v_pos + v_amt;
    HTP.prn (v_buf);
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    END;
    END run_ws;

  • Receiving a call (how to know the call from) city

    Hi, I would like to know if it's possible when you receive a call to be able to know the city of the number calling from like iphone does.
    thank you for you help
    Solved!
    Go to Solution.

    I've noticed that my phone doesn't do that either. I'm coming from a galaxy s2 on boost mobile. My old phone didn't do it for a while until I got an update from 4.0 to 4.1. It was then built into the operating system. So, unless you go with the recommendation of downloading an app, then I'm guessing that it won't be available..
    Unless BlackBerry decides to include it in a future update.. which I'd be a fan of!

  • Please help : how to know the caller ?

    Hi,
    suppose servlet 'C' can be called by servlet 'A' and servlet 'B'.
    How can servlet 'C' know by which servlet it has been called ? Is there something foreseen in HttpServletRequest ?
    Thanks,
    Javamad.

    If it needs to know that -- and in a good design it should not need to know that -- you could store something in the session object to indicate it.

  • I want to know the called Concurrent 's result in OAF

    hi, I am using the OAF page to call a concurrent. The concurrent will do something and insert some data to a table. I want to get the data in table. The question is when I query the table, the concurrent has be running. Who can tell me how to notify the OAF page when the concurrent is finished.

    Shiv,
    I don't think u would be able to implement processing page here, because how would u track in ur code that particular concurrent request has been finished?
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                           

  • Getting the caller name.

    Hi All.
    I waned to know if thre are any ways I can know the caller class/object type from with in a code.
    I mean if there is a method foo() inside, a class A.
    if there are 2 classes B and C extend A; can I write few lines of code inside A.foo() to know that the invoker of method foo is an instance of class B or C??
    Any pointers will be helpful.
    Rgds

    Use a stack trace. Keep in mind this is expensive performance-wise. Here's some code:StackTraceElement [] st=new Exception().getStackTrace();
    if(st==null)
        //Do something--some runtime environments don't support stack traces
    System.out.println("The caller is "+st[1]); That should do it.

  • Difficulty in killing the my application process

    I'm running my application by calling particular extension.
    When I'm closing the application. The application gets close. But It still run in the process.
    I ways have to do Cltr + Alt + Delete to close the process.
    Could any one tell me.How to kill the process on closing the application.
    I'm using System.exit(0); to close my application.
    Thanks.

    As I have said System.exit(0) terminates the JVM. So there is no question of any thread running within the JVM after System.exit(0) has been called.
    So it may be possible that even though the JVM you have spawned (???) is being terminated...the caller application (ie. ur .exe app) is not being terminated. So you need to pass on the terminate signal to the caller application as well. How are you spawning the JVM? Are you using java to create a process which calls another JVM where you .imt actually runs?

  • How to find the corresponding application program of an application doc. ?

    hi,
      can anybody give me some good idea on how the creation of an application document invokes a message control? i am working on interface right now. also, i am interested in knowing the corresponding application program of an application document. kindly somebody help me getting these two informations.
    waiting eagerly to award some good points to good helps.
    thanks,
    max

    sse the FUnction module ..MASTER_IDOC_DISTRIBUTE..if it is used zreport or program
    that means the message type used in the program are manually triggered.
    Prabhudas

  • Calling application from other database

    It's possible to call an application on another database, without informing user and password again?

    Sorry for being fastidious, but I don't think you can "call" an Apex application as you would call a database procedure for instance. So I assume you mean navigate from one Apex application to another Apex application in a different database.
    If you use single sign-on (SSO), that is a piece of cake.
    If you don't, there is no straightforward way I think. You can use some ingenious ways to get round it though, for instance:
    - In the calling application, using a database link, insert a token in some table in the other database along with the username and a timestamp.
    - Pass that token and the username in the URL as a parameter to an "auto login page" in the other application
    - In the "auto login page" of the other application, check whether the token/username combination is valid and, if it is, auto-login the user using the provided username.
    You also could use other fancier techniques like queues. Maybe others may have other suggestions.
    I hope this helps
    Luis

Maybe you are looking for