Re: Need help about code mobility

Gregg Wonderly <[email protected]>
Newsgroups gmane.comp.java.sun.javaspaces
Message-ID <[email protected]>
Dan Creswell wrote:
>> Before your and Dan's explanations I thought  RMI codebase property
>> specification as a true classpath extension of an application. After
>> Dan's
>
> Do you think this mistaken understanding of RMI codebase is common?
> Asked another way, do you think a lot of programmers view codebase like
> this?

I'm insterested in this as well.  That basic conceptional misunderstanding
significantly hides the details of mobile code.

Technically, the codebase IS a classpath extension.  But, it's a classpath
extension from the JVM receiving the remote object and associated codebase
annotation, not for the JVM exporting the remote object.

To understand what happens with RMI, you need to understand the MarshalledObject
class and the RMIClassLoaderSPI class.  These two work together to provide the
transport of your specified codebase to the remote JVM in the general case.

The activities of those two classes can be recreated in lots of different ways
to handle completely different types of remote invocation.  If you can wrap your
head around the simple notion of remote class loading using URLClassLoader, you
have a good start towards understanding how mobile code can work by just
allowing the object that is going somewhere to carry the URLs, instead of you
having to know about them ahead of time.

Of course security comes into play here, and JVMs receiving mobile code and
associated annotations need to be prepared to protect themselves appropriately.

> Okay, so just an FYI:
>
> I'd suggest you check out the JavaDoc for
> net.jini.loader.pref.PreferredClassLoader which provides some additional
> useful behaviours that URLClassLoader doesn't have.

Yes, this is an important class to understand the power of.

Gregg Wonderly

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JAVASPACES-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

To view past JAVASPACES-USERS postings, please see:
http://archives.java.sun.com/archives/javaspaces-users.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.