Package net.jxta.peergroup

Examples of net.jxta.peergroup.PeerGroup


    private void initialize() {
        try {
            PipeAdvertisement pipeAdv = JxtaUtil.getServerSocketAdv(
                    ReplicationUtil.getInstanceName() + "-OOB");
            JxtaStarter jxtaStarter = JxtaStarter.createInstance();
            PeerGroup netPeerGroup = jxtaStarter.getNetPeerGroup();
            serverSocket = new JxtaServerSocket(netPeerGroup, pipeAdv);
            serverSocket.setSoTimeout(0);
            logger.info(getClass().getName() + " created server socket successfully");
        } catch (Exception ex) {
            logger.log(Level.WARNING, "Unable to initialize " + getClass().getName(), ex);
View Full Code Here


     * @param instanceName name of the destination instance.
     * @return Socket connection to the destination instance.
     */
    protected Socket connect(String instanceName) {
        JxtaStarter jxtaStarter = JxtaStarter.createInstance();
        PeerGroup netPeerGroup = jxtaStarter.getNetPeerGroup();
        PipeAdvertisement pipeAdv = JxtaUtil.getServerSocketAdv(instanceName + "-OOB");
        Socket socket = null;
        PeerID peerId = null;
        try {
            peerId = JxtaUtil.getPeerID(instanceName);
View Full Code Here

        }
    }
    private PeerGroup createGroup() //This method will Create SaEeD group :-)
    {
        printOnLog("[+]Criando novo grupo...\n");
        PeerGroup myNewGroup = null;
        try{
            //specifying advertisement for group and configure group, then publish it
            //Advertisement for remote peers
            ModuleImplAdvertisement myMIA = netPeerGroup.getAllPurposePeerGroupImplAdvertisement();
            myNewGroup = netPeerGroup.newGroup(getGID(),
                                               myMIA,
                                               "EsPeTaCGrupo",
                                               "EsPeTaC P2P File Sharing Application");
            EsPeTaCAdv = myNewGroup.getPeerGroupAdvertisement();
            //publishing new group advertisements
            myDiscoveryService.publish(EsPeTaCAdv);
            myDiscoveryService.remotePublish(EsPeTaCAdv);
            printOnLog("[+]Novo grupo de PEERS criado com sucesso:-)\n");
            printOnLog("[+]Publicando novos anúncios de grupos de PEERS.\n");
View Full Code Here

TOP

Related Classes of net.jxta.peergroup.PeerGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.