Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

RMI Objectreferences

Thread view: 
Sonja Garcia Burgos - 07 Dec 2005 14:39 GMT
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
Rémi Bastide - 07 Dec 2005 15:42 GMT
> 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...

Signature

Rémi Bastide
http://liihs.irit.fr/bastide

Sonja Garcia Burgos - 07 Dec 2005 19:00 GMT
> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.