Jxta

Discuss the world of file sharing, from philosophy to help with applications.

Moderator: CricketMX Forum Moderators

Post Reply
User avatar
Rat
Drain Brain
Drain Brain
Posts: 4489
Joined: Mon Jun 14, 2004 9:38 am
Location: in the dark

Jxta is a short form for 'juxtapose' but it's also a java based system for developing p2p applications. It is an open source project.
You can read some more about it here and you can find it's home page here.
User avatar
nesman
Miracle Worker
Miracle Worker
Posts: 1456
Joined: Thu Jan 15, 2004 8:17 am
Contact:

That looks nice. I want my next cell phone to come loaded with this so I can get ringtones with no trouble.

Hmm, mobile p2p, that sounds better and better the more I think about it.
User avatar
tunebud
Miracle Worker
Miracle Worker
Posts: 3556
Joined: Mon Feb 02, 2004 12:42 pm
Location: alone in the dark

only if you like ad-ware
I seen its main source of hookup is advertisememnts
User avatar
Rat
Drain Brain
Drain Brain
Posts: 4489
Joined: Mon Jun 14, 2004 9:38 am
Location: in the dark

tunebud wrote:I seen its main source of hookup is advertisememnts
I don't think that's what you think it is. As I understand it, p2p clients 'advertise' themselves in order to find other clients and servers. This is the way that networks form. There'd be absolutely no point in an open source project containing ad-ware. Any developer that fancied doing so would just take the stuff out - end of problem. And anyway - who would benefit?

Here's the code that creates 'adverts'.

Code: Select all

{
    //We will create a new group based on the netPeerGroup so let's copy its
    //impl advertisement and modify it.
    ModuleImplAdvertisement implAdv =
      netPeerGroup.getAllPurposePeerGroupImplAdvertisement();
      
    myPeerGroup = netPeerGroup.newGroup(
            null,               //Create a new group id for this group.
            implAdv,            //Use the above advertisement.
            "Group name",       //This is the name of the group.
            "Group description" //This is the description of the group.
            );

    System.out.println("---Peer group created successfully, id: " +
      myPeerGroup.getPeerGroupAdvertisement().getID() );
    //Now that the group is created, it is automatically published and stored locally,
    //but we need to publish it remotely so other peers can discover it.
    discoveryService.remotePublish( myPeerGroup.getPeerGroupAdvertisement() );
    System.out.println("---Published peer group advertisement remotely");
}
catch (Exception e)
{
    System.out.println("An error occurred");
    e.printStackTrace();
}

The call to newGroup() creates and publishes the group to the local cache. Most likely, you will want to publish this advertisement to other peers when you create it, which you can do by calling remotePublish(). This method will push the peer group advertisement to other peers. If you need to make sure that you send the advertisement to peers on another subnet, you must ensure you are connected to a rendezvous peer.
If you've ever tried running an OpenNap server, for example, you'll know that you have to give your server a group name if you intend to use it in conjunction with other peoples' servers. You'll find the setting in the code above.
Post Reply