Re: Running Multiple Nodes inside a single JVM

Mark Griffin <[email protected]> Tue, 20 Sep 2005 16:22:54 -0500
Newsgroups gmane.comp.java.jxta.user
Message-ID <[email protected]>
VMWare could be an option too.


On Sep 20, 2005, at 1:40 PM, Azubuko Obele wrote:

>
> I have a "simple" problem but I'm finding it impossible to make it  
> work. For testing purposes, I want to be able to run several JXTA  
> nodes in the same JVM. (How on earth do other people solve this  
> problem by the way? Does everybody have arrays of machines they use  
> for testing? Ant scripts? I'd think it would be a very common  
> problem.) Ideally, I'd need to support 2-20 nodes inside a single  
> JVM that I can easily start and stop.
>
> After speaking with bondolo, it seems I need to do the following:
>
> 1) Change the JXTA_HOME system property before I start each node.
>
> 2) Run each node inside its own ClassLoader. For example use a  
> class like http://bench.jxta.org/source/browse/bench/performance/ 
> src/net/java/bench/load/PeerClassLoader.java this ... but it's not  
> clear HOW JXTA gets it's classloader. Do I just have to change the  
> thread context classloader before calling newNetPeerGroup() ?
>
> 3) Change the ports used by each Node in it's Profile -- how? It's  
> not clear at all how to do this.
>
> A little help please? Once I figure this out I'll gladly throw  
> something on the wiki so others can set up their own jxta unit  
> testing environment.