How to pass back object to client?

Forgive me if i ask too stupid question, but I really confuse what is really happen when it is not working.
Firstly, client A pass several objects to the server one by one, and the server will have to wait untill another client (let call it client b) able to process this object, and pass it back to the client a.
This object include some data that need to compute and save the result back to the object.
In this case, I have write the code to enable the server to callback client a, when the object is processed. Rather then put it in a while loop to wait the result coming back.
But I have difficult to trace back the original client. It cannot find client A and update the object.
I already read the Stock, Time example (which is in Sun website), and follow it to develop my program, but I still cannot get it right.
Does anyone know have any reference that I can look at or give some suggestion that can help.
Thank in advance and wish you have a good day.
Regards,
Tai Tan

Really thank you for your help.
But i still unable to get it right.
Can I ask you few more questions. thank.
Can I know what the 'this' in the your example mean?
try
   UnicastRemoteObject.exportObject( this );  //what is 'this' mean?
   obj = (Hello)Naming.lookup("//" + ser + ":5000/Server");
   message = obj.sayHello( this );  //what is 'this' mean?
catch (Exception e)
     System.out.println("HelloApplet exception: " +
      e.getMessage());
     e.printStackTrace();
}because the client program is not extends Applet, so if i put 'this' in the above 2 lines, it will not accept by the compiler.
one more question, I put the client class in the first 'this' means:
UnicastRemoteObject.exportObject( jobClient jc );  and passing second object in the second 'this':
//message = obj.sayHello( this );
mytemp.submitJob(jb1);
// Note: mytemp is : 'static mainServer mytemp';
// which is a remote object of the serverSo, is this the correct way to export the stub and object?
(In the example that you give, the 'this' is the same. But in my program, the second 'this', I have to call submitJob(jb1) in the server, and passing the jb1 ( is a serialize object name call jobThread.)
Thank again and sorry for giving you such trouble.

Similar Messages

  • How to pass back Subject do Client app after authentication via identity assertion

    I have developed an Identity Assertion Provider based on
    SampleIdentityAsserterProviderImpl provided by BEA.
    It seams that all works fine, but I don't now how to pass back authenticated
    Subject to client application in order to call methods runAs(Subject,
    PrivillegedAction). I have tried build Subject from
    connection.getInputStream() but when I use Subject constructed in that way I
    have received an error:
    lava.lang.SecurityException: Invalid Subject: principals=[user, usergroup1,
    usergroup1]
    Thanks in advance for any suggestions.
    Jerzy Nawrot

    Hi,
    as per the below comment.
    We want to change this and do this dynamic way so that the XCM configuration application can read these dynamic parameters and behave accordingly(like customers with different languages, client systems etc). This is the 1st part .
    You have to use different scanrios to be set in XCM like (customer specific to language, and client), and that to be passed in
    Where language specifications should maintained in XCM settings only. also to be noted that Product catalog for those should also maintain in that specific language.
    "/init.do?scenario=value2;
    The 2nd part leading this scenario is after the portal user successfully lands into ISA application, if the user needs to go back to the WDP java screen, would the JSP based ISA application be able to navigate back to the original WD Java iView Screen. ? or would it open in a new window ? (probably this can be set to be launched in same window)
    I am not sure, but if you go back to WD from ISA , ISA Session will die.
    Let me know if you have any further queries.
    Regards,
    Devender V

  • How to pass an object from jsp to other jsp using SendRedirect

    How to pass an object from one jsp to the other jsp using ssendRedirect with out using the session
    I am having 2 jsps
    x.jsp and y.jsp
    From x.jsp using sendRedirect iam going to y.jsp
    From x.jsp i have pass an object to the y.jsp
    Is it possible without putting the object in session
    Is it possible using EncodeUrl
    Please help me Its Urgent

    Is it possible without putting the object in sessionAnything is possible. Would you accept that it is very difficult?
    When you send a redirect, it tells the browser to send a new request for the target page. That means any request parameters/attributes are lost.
    Is it possible using EncodeUrl response.encodeURL() puts the session id into a url if the browser does not support cookies. It is purely for retaining the session.
    There are two ways that you can communicate across a sendRedirect.
    1 - use the session
    2 - pass a parameter in the url.
    parameters are string based, so passing objects is almost out of the question.
    Potentially you could serialize your object, encode it in base64 (so it is composed completely as characters) and pass it as a parameter to the other page, where you retrieve it, unencode it, and then load the serialized object.
    Or you can just use the session.

  • MVC2.0-- how to pass bean object to jsp

    Hi All,
    Anybody please tell me how to pass bean class object from controller to jsp ?
    I am developing an application in MVC2.0.
    I am creating an object of bean class in controller servlet and want to pass this object to jsp so anybody please tell how to pass this object to jsp.
    ControllerServlet--
    Bean obj = new Bean();
    Bean --
    public String aMethod() {
    return data;
    I have to use this method in my jsp and I am creating an object of this bean in controller servlet.
    Please help
    Thanks
    Please reply soon

    Hi,
    Thanks for your response. I knew it is possible with session objects. But I want to perform this operation with out using session objects. Is there a way to accomplish this with out using Session objects.
    Please help.
    Thanks

  • How to connect back a disconnected client on an rmi server

    I am making a client -server rmi game .
    if a client get disconnected (throwing a remote exception on the server) how can I
    have some other client or same client continue from the the same point as it got disconnected.
    it obvioulsy requires state preservation but how?

    well actually I am making a game.
    if a player logs out during the game , when the server
    tries to pass it information it gets a remoteexception at the server.
    What I need is that any other player could replace this loggged out player and should get the latest state of the game ie latest score (while other players coud play as much as they can without him) , latest turn etc.
    The game is coded in an object which contains the lates turn and score etc, but how do I give it out to a new player joining in the middle of the game?
    Also if the server keeps thrwoing remoteexceptions ,
    it might hang or might haveto be shut down to be restarted.

  • How to send multiple objects from Client to Server

    Hi
    I have a simple Client - Server architecture. I am trying to send 5 objects from Client to the Server which the server would operate on.
    In the past I've used PrintWriter to pass Strings from Client to Server but now when I am dealing with multiple Objects and PrintWriter not allowing sending of Arrays or ArrayList, how can I send these from the Client to the Server? What would be a good writer to use for this purpose?
    Thanks!

    Thanks, I am looking into ObjectOutputStream but from the API it appears I can only send 1 object at a time. I need to send 5 objects per transaction and then send the next group of 5 objects for another transaction.
    Could you clarify some more on how to put these objects together as a single Object perhaps?
    Thanks

  • How to pass back results of gATP from APO to R/3

    Dear all,
    we're currently working on a gATP implementation and face following open challenges for which we kindly ask you for your valuable support:
    1.) We need to pass back the allocated CVC of the gATP (product allocation) check from APO to z-append fields of VBAP. In order to do that we implemented additional field catalog fields which are updated in one of the product allocation userexits on APO side. Using an enhancement of form MVERF_PRUEFEN in SAPFV45V the data which is passed back from APO to R/3 via field_catalog can be written into the respective VBAP fields. ONLY: this doesn't work for a "complete delivery only" customer/order as MVERF_PRUEFEN is not called in such a case.
    ---> Do you have any proposals where/how to implement the functionality to write back the results passed back by APO into VBAP fields?
    2.) In case of incomplete confirmation (not enough qty) the "APO Product Availability Overview" screen appears. We do not want to show this screen in APO to our users. There should be just a warning message but not this full screen. Do you have any ideas how to turn off the screen (similar to what happens if the order is posted in background)
    Thanks again for your great input and help!
    M.

    Dear Mohan,
    thanks for your reply.
    We actually use the functionality you described already for passing the required additional information from R/3 to APO. What we're currently searching, is a solution to pass back results (such as the allocated CVC or additional information from APO) from APO back to R/3 and store it there in VBAP-appends.
    Thanks,
    Maawdee
    Edited by: Maawdee on Jun 25, 2010 9:18 AM

  • How to pass an object as a parameter

    how do you pass an object as a parameter? (what type should it be ?)

    Well you can use a [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html]String
    Or you can take a [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Double.html]Double
    And you can pass [url http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Event.html]Events
    and get yourself in trouble
    and you can use a [url http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Frame.html]Frame
    or maybe take a [url http://java.sun.com/j2se/1.4.2/docs/api/java/util/List.html]List
    but some will use [url http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collection.html]Collection
    depends you your direction
    so if you need to know
    if you should use a [url http://java.sun.com/j2se/1.4.2/docs/api/java/util/Map.html]Map
    then this is what to do
    just browse the [url http://java.sun.com/j2se/1.4.2/docs/api/]API

  • How to pass class object  as in parameter in call to pl/sql procedure ?

    hi,
    i have to call pl/sql proecedure through java. In pl/sql procedure as "In" parameter i have created "user defined record type" and i am passing class object as "In" parameter in call to pl/sql procedure. but it is giving error.
    so, anyone can please tell me how i can pass class object as "In" parameter in call to pl/sql procedure ?
    its urgent ...
    pls help me...

    793059 wrote:
    I want to pass a cursor to a procedure as IN parameter.You can use the PL/SQL type called sys_refcursor - and open a ref cursor and pass that to the procedure as input parameter.
    Note that the SQL projection of the cursor is unknown at compilation time - and thus cannot be checked. As this checking only happens at run-time, you may get errors attempting to fetch columns from the ref cursor that does not exist in its projection.
    You also need to ask yourself whether this approach is a logical and robust one - it usually is not. The typical cursor processing template in PL/SQL looks as follows:
    begin
      open cursorVariable;
      loop
        fetch cursorVariable bulk collect into bufferVariable limit MAX_ROWS_FETCH;
        for i in 1..bufferVariable.Count
        loop
          MyProcedure( buffer(i) );   --// <-- Pass a row structure to your procedure and not a cursor
        end loop;
        ..etc..
        exit when cursorVariable%not_found;
      end loop;
      close cursorVariable;
    end;

  • How to pass a "object" as a prameter from one java class to another java

    hi experts, I want to know "How to pass and get object as a parameter from one java class to another java class". I tried follwoing code just check it and give suggetions..
    import Budget.src.qrybean;
    public class ConfirmBillPDF extends HttpServlet
    qrybean db = new qrybean();
    SimplePDFTable pdfTable = new SimplePDFTable();
    pdfTable.simplePDFTableShow("2010","2011","1","2","1","131","102");
    }Here i want to pass db with simplePDFTableShow method. simplePDFTableShow is in another java class. So how can i do this.
    And also i want to know, how this obj will get.
    please help me.
    Edited by: andy_surya on Jul 14, 2010 7:51 AM

    Hi andy_surya
    what is this i am not understand
    pdfTable.simplePDFTableShow("2010","2011","1","2","1","131","102");but i am try to solve your problem try this
    qrybean db = new qrybean();
    SimplePDFTable pdfTable = new SimplePDFTable();
    pdfTable.simplePDFTableShow(db);and access like this in SimplePDFtable class update your method
    simplePDFTable(qrybean tempDB)
    // write your code
    }

  • How to pass JSON object for a PUT operation of restful

    Hi,
    I am trying to proxy restful call through an OSB proxy and I would like to know how I can pass json object via OSB proxy to an external rest service for a PUT operation? I am using Oracle 11g.
    I have created a business service, that point to the external rest service and created a proxy service that route to the business service. I thought it automatically takes the JSON, which is the data need to be send to the rest service, but didn't work, I get 405 error in the osb access log. is that how it works, or there is something else I need to do? if so, can you please help and tell me how?
    appreciate any kind of help.
    thanks
    Marwa.

    Hi Anju,
    Most of the example I see is dealing with data being pass either as query-string or html form. We are passing JSON object from the UI and rest services are configured to take JSON. therefore, in the PUT and POST data are passed either as an attachment or part of the request object. Do you know or have an example how to do it? I don't need to any kind of transformation of data because I need JSON on both end and I am trying to use the OSB proxy in between my UI and rest services to take advantage of monitoring capability of the OSB.
    appreciate any help, my deadline is getting close and I kind stuck.
    Thanks
    M.

  • Invoke- WmiMethod - How to pass input object

    How to pass inputobject to Invoke-WmiMethod? We tried the below it throws error
    $request = Get-WmiMethod -Class xx -NameSpace yyy -ComputerName zzz
    Invoke-WmiMethod -Name xxx -InputObject $request -ArgumentList $arg -Namespace yyy
    Error thrown because $request cannot be converted to ManagementObject.
    Please provide sample 

    Hi Rajalakshmi S,
    In addition, you got the error because you are passing it an array objects.
    Please try the script below:
    Get-WmiObject -Class Win32_Share -ComputerName $computer |
    foreach {
    “`n $($_.Name)”
    Invoke-WmiMethod -InputObject $_ -Name GetAccessMask}
    Reference from:
    https://richardspowershellblog.wordpress.com/about/
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna
    TechNet Community Support

  • How to pass an object as method parameter

    Hi Guys
    I was testing a simple program and was trying to pass an object to a method but it didnt seem to work and I couldnt find out WHY.
    I am posting the code so please let me know who can i make my method ADD_EMPLOYEE work so that when i pass an object of LCL_EMPLOYEE, it updates I_EMPLOYEE_LIST.
    *& Report:  ZOO_HR_SAMPLE_1
    *& Author:  Avinash Pandey
    *& Date:    25.03.2009
    *& Description: Concepts of OO in ABAP
    REPORT  zoo_hr_sample_1.
    *&       Class LCL_EMPLOYEE
           Local class
    CLASS lcl_employee DEFINITION.
    Public section
      PUBLIC SECTION.
    Data type
        TYPES:
          BEGIN OF t_employee,
            no  TYPE i,
            name TYPE string,
            wage TYPE i,
         END OF t_employee.
    Method
        METHODS:
          constructor
            IMPORTING im_employee_no TYPE i
                      im_employee_name TYPE string
                      im_wage TYPE i,
            add_employee
             IMPORTING im_employee TYPE REF TO lcl_employee,
           display_employee_list,
           display_employee,
           get_no EXPORTING ex_no TYPE i,
           get_name EXPORTING ex_name TYPE string,
           get_wage EXPORTING ex_wage TYPE i.
      Class methods are global for all instances
        CLASS-METHODS: display_no_of_employees.
    Protected section
      PROTECTED SECTION.
      Class data are global for all instances
        CLASS-DATA: g_no_of_employees TYPE i.
        CLASS-DATA: i_employee_list TYPE TABLE OF t_employee.
    Private section
      PRIVATE SECTION.
       CLASS-DATA: i_employee_list TYPE TABLE OF t_employee.
        DATA: g_employee TYPE t_employee.
    ENDCLASS.               "LCL_EMPLOYEE
    *&       Class (Implementation)  LCL_EMPLOYEE
           Text
    CLASS lcl_employee IMPLEMENTATION.
    Class constructor method
      METHOD constructor.
        g_employee-no = im_employee_no.
        g_employee-name = im_employee_name.
        g_employee-wage = im_wage.
        g_no_of_employees = g_no_of_employees + 1.
      ENDMETHOD.                    "constructor
    Method
      METHOD display_employee.
        WRITE:/ 'Employee', g_employee-no, g_employee-name.
      ENDMETHOD.                    "display_employee
    Method
      METHOD get_no.
        ex_no = g_employee-no.
      ENDMETHOD.                    "get_no
    Method
      METHOD get_name.
        ex_name = g_employee-name.
        WRITE: / 'Name is:' , ex_name.
      ENDMETHOD.                    "get_no
    Method
      METHOD get_wage.
        ex_wage = g_employee-wage.
      ENDMETHOD.                    "get_no
    Method
      METHOD add_employee.
      Adds a new employee to the list of employees
        DATA: l_employee TYPE t_employee.
        l_employee-no = im_employee->get_no.
        l_employee-name = im_employee->get_name.
        l_employee-wage = im_employee->get_wage.
        APPEND l_employee TO i_employee_list.
      ENDMETHOD.                    "add_employee
    Method
      METHOD display_employee_list.
      Displays all employees and there wage
        DATA: l_employee TYPE t_employee.
        WRITE: / 'List of Employees'.
        LOOP AT i_employee_list INTO l_employee.
          WRITE: / l_employee-no, l_employee-name, l_employee-wage.
        ENDLOOP.
      ENDMETHOD.                    "display_employee_list
    Class method
      METHOD display_no_of_employees.
        WRITE: / 'Number of employees is:', g_no_of_employees.
      ENDMETHOD.                    "display_no_of_employees
    ENDCLASS.               "LCL_EMPLOYEE
    REPORT
    DATA: g_employee1 TYPE REF TO lcl_employee,
          g_employee2 TYPE REF TO lcl_employee.
    START-OF-SELECTION.
    Create class instances
      CREATE OBJECT g_employee1
        EXPORTING
          im_employee_no   = 1
          im_employee_name = 'John Jones'
          im_wage          = 20000.
      CREATE OBJECT g_employee2
        EXPORTING
          im_employee_no   = 2
          im_employee_name = 'Sally Summer'
          im_wage          = 28000.
    Call methods
      CALL METHOD g_employee1->display_employee.
      CALL METHOD g_employee1->add_employee
        EXPORTING
          im_employee = g_employee1.
      CALL METHOD g_employee1->get_name.
      CALL METHOD g_employee2->display_employee.
      CALL METHOD g_employee2->display_no_of_employees.
    The error I am getting is:
    Field GET_NO/GET_NAME/GET_WAGE is unknown.
    Please help me out on this.
    Thanks a lot you people

    hi.
    The following parts of your program were changed.
    The result is OK?.
    *(1)change
    CLASS lcl_employee DEFINITION.
    Public section
    PUBLIC SECTION.
    display_employee,
    *get_no EXPORTING ex_no TYPE i,
    *get_name EXPORTING ex_name TYPE string,
    *get_wage EXPORTING ex_wage TYPE i.
    get_no returning value(ex_no) TYPE i,
    get_name returning value(ex_name) TYPE string,
    get_wage returning value(ex_wage) TYPE i.
    *(2)change
    CLASS lcl_employee IMPLEMENTATION.
    Method
    METHOD add_employee.
    Adds a new employee to the list of employees
    DATA: l_employee TYPE t_employee.
    *l_employee-no = im_employee->get_no.
    *l_employee-name = im_employee->get_name.
    *l_employee-wage = im_employee->get_wage.
    l_employee-no   = im_employee->get_no( ).
    l_employee-name = im_employee->get_name( ).
    l_employee-wage = im_employee->get_wage( ).
    APPEND l_employee TO i_employee_list.
    ENDMETHOD. "add_employee
    Result List
    Employee          1  John Jones
    Name is: John Jones
    Name is: John Jones
    Employee          2  Sally Summer
    Number of employees is:          2

  • How to Pass Java Objects between Web Dynpro and Java SAP iViews

    Basically I have an SAP web dynpro iView that I do stuff with and I want to pass an object to another iView which is just a regular Java iView. From what I've read and tried, I can't just stick something in the session object and hope that the Java iView can pull it down the other end. I had a dream that it was possible (seriously).
    Anyway, are there any possible solutions around? Please advice and share you throughts. I will try to dream about it again tonight and see if its really gonna work this time.
    thanks for your help in advance

    There is no easy way you can pass objects other than those supported by express such as String, map, list etc.
    Though not advised, you can create a class with static variables to handle the storage of such java objects during transition between form and workflow. You will need to somehow identify the objects uniquely .

  • How to pass serialized object and the string through the socket together?

    I have an application which listens on a port and I usually read string lines from it. Now I want to pass serialised object through it , plus I should indicate (using some string like "object coming") tht the following packet is a serialized object.

    Since Strings are serializable you could just send a stream of serialized objects then you don't have to know anything about the format.

Maybe you are looking for