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()) {