Examples of PeerCreator


Examples of lupos.distributed.p2p.gui.PeerCreator

      /*
       * sets the distribution
       */
      distribution = (IDistributionKeyContainer<?>) Class.forName(
          this.distributionStrategyClass).newInstance();
      final PeerCreator pc = new PeerCreator().setP2PNetwork(
          this.networkImplementation, arguments).setDistributionStrategy(
          distribution);
      pc.setUseSubgraphSubmission(!this.useNoSGSubmission);


      if (this.storageBlockSize != 0) {
        final int bSize = this.storageBlockSize;
        this.storageClassConfiguration = new IConfigurator<BlockStorageWithDistributionStrategy>() {
          @Override
          public String toString() {
            return "blockSize = " + bSize;
          }
          @Override
          public void doConfiguration(
              final BlockStorageWithDistributionStrategy storage) {
            storage.setBlockSize(bSize);

          }
        };
      }
      if (this.storageClass != null) {
        try {
          final Class<? extends StorageWithDistributionStrategy> c = (Class<? extends StorageWithDistributionStrategy>) Class.forName(this.storageClass);
          pc.setStorage(c,this.storageClassConfiguration);
        } catch (ClassCastException | ClassNotFoundException e) {
          System.err.println(String.format("Storage-implementation %s not found or not valid.",this.storageClass));
        }
      }


      pc.start();
      System.out.println("Started.");

      /*
       * start the node, activates input mode on console
       */
 
View Full Code Here

Examples of net.tomp2p.connection.PeerCreator

    if(sendBehavior == null) {
      sendBehavior = new DefaultSendBehavior();
    }
   
    final PeerCreator peerCreator;
    if (masterPeer != null) {
      peerCreator = new PeerCreator(masterPeer.peerCreator(), peerId, keyPair);
    } else {
      peerCreator = new PeerCreator(p2pID, peerId, keyPair, channelServerConfiguration,
              channelClientConfiguration, scheduledExecutorService, sendBehavior);
    }

    final Peer peer = new Peer(p2pID, peerId, peerCreator);

    PeerBean peerBean = peerCreator.peerBean();
    peerBean.addPeerStatusListener(peerMap);
   
    ConnectionBean connectionBean = peerCreator.connectionBean();

    peerBean.peerMap(peerMap);
    peerBean.keyPair(keyPair);

    if (bloomfilterFactory == null) {
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.