Re: Need help about code mobility

Dan Creswell <[email protected]>
Newsgroups gmane.comp.java.sun.javaspaces
Message-ID <[email protected]>
Andrea Angeloni wrote:
>> I'm not familiar with the example but I would imagine the producer
>> process has a direct dependency on PrimeJob in that it uses it's
>> constructor and fills in the fields.
>
> yes, this is the case under the producer:
>
> PrimeJob job = new PrimeJob(nextNumberToCalculate);
>

So that's going to need to be in the classpath, then.

>> With that being the case, setting java.rmi.server.codebase doesn't help
>> because that will be applied to outgoing classes, not incoming ones.
>
> This is a very big surprise for me, I thought that codebase setting is just
> like a "classpath setting". I've learnead about RMIClassloader annotation,
> but I 've never considered this aspect.
>

Well codebase is kind of a classpath but it's a classpath for _remote_
JVM's not the _local_ JVM it's specified against.

>
>> Thus PrimeJob needs to be in the Producer's classpath.  You can likely
>> get the client to download PrimeJob but you'll probably need to adjust
>> the code to not explicitly mention it in it's own code.
>
>> There are methods for modifying the Producer to not need PrimeJob in
>> it's classpath and download it across the net but if all you want to do
>> is see remote code loading at work, modifying the client side will be a
>> lot easier.
>
> The purpose of my study: I'm trying to see if is possibile to use
> RMI/Jini/Javaspaces code downloading feature to develop applications in
> with
> some classes are deployed in a repository, in particular with inheritance
> relations between remote classes. I've considered JavaSpaces, because I've
> found it a little higher level than pure RMI. So, I've started to study the
> possibility to having JavaSpaces entry classes in a remote repository, used
> by applications that use the space.
>

That's a typical usage pattern for both JavaSpaces and RMI.  I take your
point on JavaSpaces being "higher level" - that's true in many cases
(not all!).

I would suggest you go look at some of the compute server examples for
JavaSpaces as they certainly provide demonstrations of the kind of
behaviour you're looking for.

> Can you indicate me a way how I can modify the producer code to have the
> right behaviour?
>

Sorry, no.  I could indeed make the changes but it's more than just a
code change and unfortunately, I have a lot of other things I need to
do.  Hopefully the compute server examples will provide sufficient
detail for you to achieve your goal.

Dan.

===========================================================================
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.