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 / January 2006

Tip: Looking for answers? Try searching our database.

RMI conundrum

Thread view: 
VisionSet - 23 Dec 2005 17:25 GMT
I send an object over RMI

myRemoteMethod(myObject);

But I want to do something to myObject after it has been safely serialised
(ie I don't want the server to know of the change I want to make). I don't
want to have to wait until the remote method returns. If I fire the method
off in its own thread then I can ascertain when that thread is running, but
I can't be sure when myObject has been serialised.
I realise I can get round this by cloning myObject but is there an
alternative.  Seems a pain to have to implement cloning throughout my object
tree just for this, especially when serialisation is going to do it for me -
just that I can't get at it - or can I?

--
Mike W
Mandar Amdekar - 02 Jan 2006 22:29 GMT
No automatic way as near as I can tell.

However, you could override the serialization / externalization method
in the class that is the root of your complex data structure, and as
part of it, implement the observer pattern.  Then you simply hook up
one or more observers to all root objects on creation (for simplicity)
and in the observer, use some sort of a delay before triggering the
change logic.
VisionSet - 02 Jan 2006 22:42 GMT
> No automatic way as near as I can tell.
>
[quoted text clipped - 4 lines]
> and in the observer, use some sort of a delay before triggering the
> change logic.

Good idea, I may well do that.
I'll have to check that the order of serialisation runs children first, root
last though.

--
Mike W


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



©2009 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.