|
From: Naveen B. <nav...@re...> - 2004-12-14 10:09:38
|
=A0> i am new to jxta,i am running a simple program,but i dont know what=
=0A> to give on the configuration dialog for "Rendezovus/Relay" and =0A> "=
Advanced" options.pls clear me=0A=0Amy code is=0A--------------------------=
---------------------------------------------=0A=0Aimport net.jxta.peergrou=
p.PeerGroup;=0Aimport net.jxta.peergroup.PeerGroupFactory;=0Aimport net.jxt=
a.exception.PeerGroupException;=0A/*=0A This is a simple example of how an =
application would start jxta=0A */=0A public class SimpleJxtaApp {=0A=0A st=
atic PeerGroup netPeerGroup =3D null;=0A=0A public static void main(String =
args[]) {=0A=0A System.out.println ("Starting JXTA ....");=0A SimpleJxtaApp=
myapp =3D new SimpleJxtaApp();=0A myapp.startJxta();=0A System.out.println=
("Hello from JXTA group " +=0A netPeerGroup.getPeerGroupName() );=0A Syste=
m.out.println (" Group ID =3D " +=0A netPeerGroup.getPeerGroupID().toString=
());=0A System.out.println (" Peer name =3D " +=0A netPeerGroup.getPeerName=
());=0A System.out.println (" Peer ID =3D " +=0A netPeerGroup.getPeerID().t=
oString());=0A System.out.println ("Good Bye ....");=0A myapp.netPeerGroup.=
stopApp();=0A }=0A=0A private void startJxta() {=0A try {=0A // create and =
start the default JXTA NetPeerGroup=0A netPeerGroup =3D PeerGroupFactory.ne=
wNetPeerGroup();=0A }=0A catch (PeerGroupException e) {=0A // could not ins=
tantiate the group, print the stack and exit=0A System.out.println("fatal e=
rror : group creation failure");=0A e.printStackTrace();=0A System.exit(1);=
=0A }=0A }=0A }=0A=0A------------------------------------------------------=
-----------------=0A=0Aregards,=0A=0A=0ANaveen Babu.A |