Package net.tomp2p.dht

Examples of net.tomp2p.dht.PeerDHT.shutdown()


    } finally {
      if(master != null) {
        master.shutdown().await();
      }
      if(unreachablePeer != null) {
        unreachablePeer.shutdown().await();
      }
    }
  }

  @Test
View Full Code Here


            exampleAttack(key1, peers);
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            if (master != null) {
                master.shutdown();
            }
        }
    }

    /**
 
View Full Code Here

            exampleGetNonBlocking(peers, nr);
            Thread.sleep(waitingTime);
            exampleAddGet(peers);
        } finally {
            if (master != null) {
                master.shutdown();
            }
        }
    }

    /**
 
View Full Code Here

          Data d = iterator.next();
          System.out.println("got: " + d.object().toString());
        }
      }
    } finally {
      peer.shutdown();
    }
  }

  public static void main(String[] args) throws Exception {
    if (args.length > 1 && args[0].equals("bootstrap")) {
View Full Code Here

            master = peers[0];
            ExampleUtils.bootstrap(peers);
            exampleMultiColumn(peers);
        } finally {
            if (master != null) {
                master.shutdown();
            }
        }
    }

    /**
 
View Full Code Here

            }
            if (master != null) {
                master.shutdown().await();
            }
            if (slave != null) {
                slave.shutdown().await();
            }
        }
    }

    /**
 
View Full Code Here

            Assert.assertEquals(1, test1.get());
            Assert.assertEquals(2, test2.get());

            PeerAddress slaveAddress2 = slave2.peerAddress();
            slave2.shutdown().await();
            master.peerBean().peerMap().peerFailed(slaveAddress2, new PeerException(AbortCause.SHUTDOWN, "shutdown"));

            Assert.assertEquals(1, test1.get());
            Assert.assertEquals(3, test2.get());
View Full Code Here

          }
        }
      }
    } finally {
      if (master != null) {
        master.shutdown().await();
      }
    }
  }

  private static Number160 generateVersionKey(long basedOnCounter, Serializable object) throws IOException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.