Examples of ByteMessage


Examples of org.apache.catalina.tribes.ByteMessage

                Logs.MESSAGES.trace("GroupChannel - Received msg:" + new UniqueId(msg.getUniqueId()) + " at " +new java.sql.Timestamp(System.currentTimeMillis())+ " from "+msg.getAddress().getName());
            }

            Serializable fwd = null;
            if ( (msg.getOptions() & SEND_OPTIONS_BYTE_MESSAGE) == SEND_OPTIONS_BYTE_MESSAGE ) {
                fwd = new ByteMessage(msg.getMessage().getBytes());
            } else {
                try {
                    fwd = XByteBuffer.deserialize(msg.getMessage().getBytesDirect(), 0, msg.getMessage().getLength());
                }catch (Exception sx) {
                    log.error("Unable to deserialize message:"+msg,sx);
View Full Code Here

Examples of org.apache.catalina.tribes.ByteMessage

        channel1.start(Channel.DEFAULT);
        channel2.start(Channel.DEFAULT);
        //Thread.sleep(1000);
        assertEquals("Expecting member count to be equal",mbrlist1.members.size(),mbrlist2.members.size());
        channel2.stop(Channel.SND_RX_SEQ);
        ByteMessage msg = new ByteMessage(new byte[1024]);
        try {
            channel1.send(channel1.getMembers(), msg, 0);
            fail("Message send should have failed.");
        } catch ( ChannelException x ) {
            // Ignore
View Full Code Here

Examples of org.apache.catalina.tribes.ByteMessage

        channel1.start(Channel.DEFAULT);
        channel2.start(Channel.DEFAULT);
        //Thread.sleep(1000);
        assertEquals("Expecting member count to be equal",mbrlist1.members.size(),mbrlist2.members.size());
        channel2.stop(Channel.MBR_TX_SEQ);
        ByteMessage msg = new ByteMessage(new byte[1024]);
        try {
            Thread.sleep(5000);
            assertEquals("Expecting member count to be equal",mbrlist1.members.size(),mbrlist2.members.size());
            channel1.send(channel1.getMembers(), msg, 0);
        } catch ( ChannelException x ) {
View Full Code Here

Examples of org.apache.catalina.tribes.ByteMessage

        channel1.start(Channel.DEFAULT);
        channel2.start(Channel.DEFAULT);
        //Thread.sleep(1000);
        assertEquals("Expecting member count to be equal",mbrlist1.members.size(),mbrlist2.members.size());
        channel2.stop(Channel.SND_RX_SEQ);
        ByteMessage msg = new ByteMessage(new byte[1024]);
        try {
            channel1.send(channel1.getMembers(), msg, 0);
            fail("Message send should have failed.");
        } catch ( ChannelException x ) {
            // Ignore
View Full Code Here

Examples of org.apache.catalina.tribes.ByteMessage

        channel1.start(Channel.DEFAULT);
        channel2.start(Channel.DEFAULT);
        //Thread.sleep(1000);
        assertEquals("Expecting member count to be equal",mbrlist1.members.size(),mbrlist2.members.size());
        channel2.stop(Channel.MBR_TX_SEQ);
        ByteMessage msg = new ByteMessage(new byte[1024]);
        try {
            Thread.sleep(5000);
            assertEquals("Expecting member count to be equal",mbrlist1.members.size(),mbrlist2.members.size());
            channel1.send(channel1.getMembers(), msg, 0);
        } catch ( ChannelException x ) {
View Full Code Here

Examples of org.apache.catalina.tribes.ByteMessage

                        msg.getAddress().getName());
            }

            Serializable fwd = null;
            if ( (msg.getOptions() & SEND_OPTIONS_BYTE_MESSAGE) == SEND_OPTIONS_BYTE_MESSAGE ) {
                fwd = new ByteMessage(msg.getMessage().getBytes());
            } else {
                try {
                    fwd = XByteBuffer.deserialize(msg.getMessage().getBytesDirect(), 0,
                            msg.getMessage().getLength());
                }catch (Exception sx) {
View Full Code Here

Examples of org.apache.catalina.tribes.ByteMessage

                Logs.MESSAGES.trace("GroupChannel - Received msg:" + new UniqueId(msg.getUniqueId()) + " at " +new java.sql.Timestamp(System.currentTimeMillis())+ " from "+msg.getAddress().getName());
            }

            Serializable fwd = null;
            if ( (msg.getOptions() & SEND_OPTIONS_BYTE_MESSAGE) == SEND_OPTIONS_BYTE_MESSAGE ) {
                fwd = new ByteMessage(msg.getMessage().getBytes());
            } else {
                try {
                    fwd = XByteBuffer.deserialize(msg.getMessage().getBytesDirect(), 0, msg.getMessage().getLength());
                }catch (Exception sx) {
                    log.error("Unable to deserialize message:"+msg,sx);
View Full Code Here

Examples of org.apache.catalina.tribes.ByteMessage

        channel1.start(Channel.DEFAULT);
        channel2.start(Channel.DEFAULT);
        //Thread.sleep(1000);
        assertEquals("Expecting member count to be equal",mbrlist1.members.size(),mbrlist2.members.size());
        channel2.stop(Channel.SND_RX_SEQ);
        ByteMessage msg = new ByteMessage(new byte[1024]);
        try {
            channel1.send(channel1.getMembers(), msg, 0);
            fail("Message send should have failed.");
        } catch ( ChannelException x ) {
            // Ignore
View Full Code Here

Examples of org.apache.hama.bsp.ByteMessage

      for (int i = 0; i < nSupersteps; i++) {

        for (int j = 0; j < nCommunications; j++) {
          String tPeer = peers[r.nextInt(peers.length)];
          String tag = peerName + " to " + tPeer;
          msg = new ByteMessage(Bytes.toBytes(tag), dummyData);
          peer.send(tPeer, msg);
        }

        peer.sync();

        ByteMessage received;
        while ((received = (ByteMessage) peer.getCurrentMessage()) != null) {
          LOG.info(Bytes.toString(received.getTag()) + " : "
              + received.getData().length);
        }

      }
    }
View Full Code Here

Examples of org.apache.hama.bsp.ByteMessage

      for (int i = 0; i < nSupersteps; i++) {

        for (int j = 0; j < nCommunications; j++) {
          String tPeer = peers[r.nextInt(peers.length)];
          String tag = peerName + " to " + tPeer;
          msg = new ByteMessage(Bytes.toBytes(tag), dummyData);
          bspPeer.send(tPeer, msg);
        }

        bspPeer.sync();

        ByteMessage received;
        while ((received = (ByteMessage) bspPeer.getCurrentMessage()) != null) {
          LOG.info(Bytes.toString(received.getTag()) + " : "
              + received.getData().length);
        }

      }
    }
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.