RMI Objectreferences

Discussion in 'Java' started by Sonja Garcia Burgos, Dec 7, 2005.

  1. Hi @all,

    I`m actually working at some piece of software
    with RMI and I wonder, if it is possible, to
    reference in my remote class to an object wich is
    not remote

    Example:

    //Somewhere at server side
    public class Machine extends UnicastRemoteObject implements IMachine,
    Serializable
    {
    //no RemoteObject!
    private static Fields fields;

    public String getMachineName()
    {
    return fields.getField("machine_name").getValue();
    }
    public void setMachineName(String val)
    {
    fields.setField("machine_name").setValue(val);
    }
    }

    -------------------------------------------------------------
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    -------------------------------------------------------------

    //Somewhere at client side

    ....

    IMachine machine = (IMachine)Naming.lookup....
    machine.setMachineName("test");
    System.out.println(machine.getMachineName());



    I hope someone knows something.

    greetings
    Sonja
    Sonja Garcia Burgos, Dec 7, 2005
    #1
    1. Advertising

  2. Sonja Garcia Burgos wrote:

    > Hi @all,
    >
    > I`m actually working at some piece of software
    > with RMI and I wonder, if it is possible, to
    > reference in my remote class to an object wich is
    > not remote
    >

    Sure ! All parameters you transmit to your remote object must be
    Serializable, which of course is the case for String.
    Of course, you transmit A COPY of the parameter !
    By the way, remote references are also serializable...

    --
    RĂ©mi Bastide
    http://liihs.irit.fr/bastide
    =?ISO-8859-15?Q?R=E9mi?= Bastide, Dec 7, 2005
    #2
    1. Advertising


  3. > Sure ! All parameters you transmit to your remote object must be
    > Serializable, which of course is the case for String.
    > Of course, you transmit A COPY of the parameter !
    > By the way, remote references are also serializable...
    >


    thanks :)
    I'll try it again. Maybe I did something wrong before.
    Sonja Garcia Burgos, Dec 7, 2005
    #3
    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. =?Utf-8?B?TmFpbmVzaCBKaGF2ZXJp?=

    java.rmi support inside Visual J# .NET

    =?Utf-8?B?TmFpbmVzaCBKaGF2ZXJp?=, Nov 29, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,616
    =?Utf-8?B?TmFpbmVzaCBKaGF2ZXJp?=
    Nov 30, 2004
  2. Buu Nguyen

    RMI, JINI or RMI/IIOP

    Buu Nguyen, Aug 25, 2004, in forum: Java
    Replies:
    1
    Views:
    543
    Sudsy
    Aug 25, 2004
  3. JScoobyCed

    RMI Vs RMI over IIOP

    JScoobyCed, Jan 28, 2005, in forum: Java
    Replies:
    1
    Views:
    716
    Dag Sunde
    Jan 28, 2005
  4. Jan Schulze
    Replies:
    1
    Views:
    554
    Esmond Pitt
    Mar 26, 2005
  5. aidy
    Replies:
    0
    Views:
    74
Loading...

Share This Page