Package rice.pastry

Examples of rice.pastry.PastryNodeFactory


                  envProperties.getProperty(key));
            }
          }
        }
        NodeIdFactory idFactory = new RandomNodeIdFactory(env);
        PastryNodeFactory factory = new SocketPastryNodeFactory(
            idFactory, pastryPort, env);
        NodeHandle bootHandle = null;
        InetSocketAddress bootSockAddr = null;
        if (bootAddress != null) {
          InetAddress iaddr = InetAddress.getByName(bootAddress);
          bootSockAddr = new InetSocketAddress(
              iaddr, bootPort);
          bootHandle = ((SocketPastryNodeFactory) factory)
              .getNodeHandle(bootSockAddr);
        }
        PastryNode newNode = null;
        if (this.nodeId == null) {
          newNode = factory.newNode(bootHandle);
          this.nodeId = newNode.getId().toStringFull();
        } else {
          newNode = factory.newNode(bootHandle, Id.build(nodeId));
        }
        synchronized (newNode) {
          while (!newNode.isReady() && !newNode.joinFailed()) {
            newNode.wait(500);
            if (newNode.joinFailed()) {
View Full Code Here

TOP

Related Classes of rice.pastry.PastryNodeFactory

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.