Re: Distributed Object class loading semantics
Re: Distributed Object class loading semantics
- Subject: Re: Distributed Object class loading semantics
- From: James Quick <email@hidden>
- Date: Sun, 3 Aug 2003 21:32:56 -0400
On Sunday, August 3, 2003, at 05:56 PM, thomas robson wrote:
From what I understand, when using Distributed Objects, using an
object as a
"bcopy" parameter in a method call is only valid if the class of the
object is already in the address space of the distant server. This
seems to make sense, however, I'd like to send an arbitrary object
(id) to the server and then introspect it on the server side. I'd
love to have some way of having the class autoload on the server side
(similar for example to how RMI uses a classpath to load the object
over the network). Can anyone think of a way of approaching this?
How about doing something like the following:
The following assumes you asked if it knew about a particular version
of a class and it
said no.
On the sending side, first verify where it came from.
NSBundle *bundle = [NSBundle mainBundle]
bundle = [[anObject class] bundleForClass]; // We've got the bundle it
came from
now:
[bundle bundlePath] will give the pathname of the bundle , and
[bundle infoDictionay] will give the info.plist data.
Armed with that, you can send identifying information about where to
find the resources
needed to understand the object.
On the server side, you can then use the path and info.plist
information to search for
the resource, and verify that is the correct version, (or verify if you
have the resources
already in your image.
Now, load the bundle (framework, lib, or plugin), and bind it into the
servers image.
Finally, shake hands with the client to say it's OK to send it.
Of course, once loaded, the server may be unable to unload it again, so
for
this kind of service you may want to consider, forking a copy of the
server, and
reuniting with the client before actually loading and binding.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.