RMI Objectreferences

  • Thread starter Sonja Garcia Burgos
  • Start date
S

Sonja Garcia Burgos

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
 
?

=?ISO-8859-15?Q?R=E9mi?= Bastide

Sonja said:
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...
 
S

Sonja Garcia Burgos

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top