Package net.tomp2p.connection

Examples of net.tomp2p.connection.PeerException


            master.peerBean().peerMap().peerFound(slave2.peerAddress(), null, null);

            System.err.println("both peers online");
            PeerAddress slaveAddress1 = slave1.peerAddress();
            slave1.shutdown().await();
            master.peerBean().peerMap().peerFailed(slaveAddress1, new PeerException(AbortCause.SHUTDOWN, "shutdown"));

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

        } finally {
View Full Code Here


        replicateOther.set(0);
      }
     
      for (int i = 0; i < leaves.length; i++) {
        // remove a peer
        master.peerBean().peerMap().peerFailed(peers.get(i+1).peerAddress(), new PeerException(AbortCause.SHUTDOWN, "shutdown"));
        // verify replication notifications
        Assert.assertEquals(leaves[i][0], replicateI.get());
        replicateI.set(0);
        Assert.assertEquals(leaves[i][1], replicateWe.get());
        replicateWe.set(0);
View Full Code Here

        try {
            handleResponse(requestMessage, peerConnection, sign, responder);
        } catch (Throwable e) {
          synchronized (peerBean.peerStatusListeners()) {
            for (PeerStatusListener peerStatusListener : peerBean.peerStatusListeners()) {
          peerStatusListener.peerFailed(requestMessage.sender(), new PeerException(e));
        }
          }
          LOG.error("Exception in custom handler", e);
            responder.failed(Type.EXCEPTION , e.toString());
        }
View Full Code Here

      throw new IllegalArgumentException("Message content is wrong");
    }
    LOG.debug("received QUIT message {}", message);
    synchronized (peerBean().peerStatusListeners()) {
      for (PeerStatusListener peerStatusListener : peerBean().peerStatusListeners()) {
        peerStatusListener.peerFailed(message.sender(), new PeerException(AbortCause.SHUTDOWN, "shutdown"));
      }
    }
    if (message.isUdp()) {
      responder.responseFireAndForget();
    } else {
View Full Code Here

TOP

Related Classes of net.tomp2p.connection.PeerException

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.