Package net.tomp2p.relay

Examples of net.tomp2p.relay.PeerMapUpdateTask


    return distributedRelay;
  }

  private Shutdown startRelayMaintenance(final FutureRelay futureRelay, BootstrapBuilder bootstrapBuilder,
      DistributedRelay distributedRelay) {
    final PeerMapUpdateTask peerMapUpdateTask = new PeerMapUpdateTask(relayRPC, bootstrapBuilder, distributedRelay,
        manualRelays, maxFail);
    peer.connectionBean().timer().scheduleAtFixedRate(peerMapUpdateTask, 0, peerMapUpdateInterval(), TimeUnit.SECONDS);

    final Shutdown shutdown = new Shutdown() {
      @Override
      public BaseFuture shutdown() {
        peerMapUpdateTask.cancel();
        return new FutureDone<Void>().done();
      }
    };
    peer.addShutdownListener(shutdown);

    return new Shutdown() {
      @Override
      public BaseFuture shutdown() {
        peerMapUpdateTask.cancel();
        peer.removeShutdownListener(shutdown);
        return new FutureDone<Void>().done();
      }
    };
  }
View Full Code Here

TOP

Related Classes of net.tomp2p.relay.PeerMapUpdateTask

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.