Skip to main content

Version 2.5rc3 with JXTA Extension Configuration?

6 replies [Last post]
thanhlb
Offline
Joined: 2004-04-07
Points: 0

Dear all,

Today I download the lasted of jxta release(2.5rc3) seem not include JXTA Extension.
From now will we define a node configurations with a simplified NeworkManager class?

I have some confused about this class.
1. Do we need implement RendezVousService with AD_HOC or EDGE peer?
2. Configurations will persisted after NeworkManager.startNetwork() method done. How can I have a chance to custom a publicSeedingRdvURI/publicSeedingRelayURI or the other stuff??

Best regards,

-thanhlb

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
thanhlb
Offline
Joined: 2004-04-07
Points: 0

Sorry, that is my mistake to use API.

thanhlb
Offline
Joined: 2004-04-07
Points: 0

Dear all,

I can not full override seedingURI and below snippet configuration. I set configuration before call startNetwork() method. How can I full override seedingURI?

※



http://rdv.jxtahosts.net/cgi-bin/rendezvous.cgi?3
http://hostname/cgi-bin/relays/relays.cgi

hamada
Offline
Joined: 2003-06-12
Points: 0

post the code fragment, and we'll try to help

thanhlb
Offline
Joined: 2004-04-07
Points: 0

Dear all,

Thanks for your reply, Hamada. Here is my code snippet and Platform configuration attachment.

★JxtaSpaceManager Class : This is singleton class.

protected final transient URI publicSeedingRdvURI = URI.create("http://hostname/cgi-bin/relays/relays.cgi");
protected final transient URI publicSeedingRelayURI = URI.create("http://hostname/cgi-bin/relays/relays.cgi");

public void configure(String mode, String user, String pass) {
if (!isConfigured()) {
log.info("※※※Creating new Network Configuration with ["+ user + "] -- [" + pass +"]");

try {
jxtaNetwork = new NetworkManager(NetworkManager.ConfigMode.EDGE, user, cacheHome.toURI());
/// Uncomment if you want to extra configuration
NetworkConfigurator netConfig = jxtaNetwork.getConfigurator();
netConfig.setPrincipal(user);
netConfig.setPassword(pass);
netConfig.addRdvSeedingURI(publicSeedingRdvURI);
netConfig.addRelaySeedingURI(publicSeedingRelayURI);
} catch (java.io.IOException ioe) {
log.info("NetworkConfigurator failed: " +ioe.getMessage());
}
}
}

★Other class:

protected boolean startJXTA() throws PeerGroupException, Exception {
// This is singleton class to manage my virtual space (Group, Adv ...etc.)
NetworkManager jxtaNetwork = JxtaSpaceManager.loadPersistence();

try {
log.info(MessageFormat.format("Starting the JXTA platform in mode : {0}", jxtaNetwork.getMode()));
long startTime = System.currentTimeMillis();
// Start and persist configuration go here
jxtaNetwork.startNetwork();
long endTime = System.currentTimeMillis();
log.info(MessageFormat.format("Network started in {0} millis", endTime - startTime));

netPeerGroup = jxtaNetwork.getNetPeerGroup();
applicationPeerGroup = netPeerGroup;

/// Other stuff /////
...
}

thanhlb
Offline
Joined: 2004-04-07
Points: 0

Thanks for your guide.

hamada
Offline
Joined: 2003-06-12
Points: 0

here's an example

manager = new NetworkManager(NetworkManager.ConfigMode.EDGE, "JxtaBidiPipeExample", home.toURI());
NetworkConfigurator config = manager.getConfigurator();
config.setTcpIncoming(false);
seed.add("tcp://"+InetAddress.getLocalHost().getHostAddress()+":9701");
config.setRelaySeedURIs(seed);
config.setRendezvousSeedURIs(seed);
manager.startNetwork();