Package org.jgroups

Examples of org.jgroups.ReceiverAdapter


         }

         public synchronized void connect() throws Exception
         {
            if (channel.isConnected()) return;
            channel.setReceiver(new ReceiverAdapter()
            {

               @Override
               public void receive(Message msg)
               {
View Full Code Here


     */
    @Test
    public void testStress() throws Exception {
        channel=createTunnelChannel("A");
        channel.connect("agroup");
        channel.setReceiver(new ReceiverAdapter() {

            @Override
            public void receive(Message msg) {
                receivedCnt++;
                if(receivedCnt % 2000 == 0)
View Full Code Here

          new UFC(),
          new MFC(),
          new FRAG2()};
        JChannel ch=new JChannel(prot_stack).name(args[0]);

        ch.setReceiver(new ReceiverAdapter() {
            public void viewAccepted(View new_view) {
                System.out.println("view: " + new_view);
            }

            public void receive(Message msg) {
View Full Code Here

     * Issue: https://issues.jboss.org/browse/JGRP-1545
     */
    @BMScript(dir="scripts/MessageBeforeConnectedTest", value="testSendingOfMsgsOnUnconnectedChannel")
    public void testSendingOfMsgsOnUnconnectedChannel() throws Throwable {
        a=createChannel("A");
        a.setReceiver(new ReceiverAdapter() {
            public void receive(Message msg)  {
                MessageBeforeConnectedTest.this.receive(msg);
            }
        });
        a.connect("MessageBeforeConnectedTest");
View Full Code Here

     * thread. Note that the suggested fix on JGRP-1522 will solve this. Issue: https://issues.jboss.org/browse/JGRP-1522
     */
    @BMScript(dir="scripts/BecomeServerTest", value="testSendingOfMsgsOnUnconnectedChannel")
    public void testSendingOfMsgsOnUnconnectedChannel() throws Exception {
        a=createChannel("A");
        a.setReceiver(new ReceiverAdapter() {
            public void receive(Message msg)  {
                System.out.println("A: received message from " + msg.getSrc() + ": " + msg.getObject());
            }
        });
        a.connect("BecomeServerTest");

        new Thread("MsgSender-A") {
            public void run() {
                sendMessage(a, "hello from A"); // will be blocked by byteman rendezvous
            }
        }.start();

        b=createChannel("B");
        b.setReceiver(new ReceiverAdapter() {
            public void receive(Message msg) {
                System.out.println("B: received message from " + msg.getSrc() + ": " + msg.getObject());
                if(msg.getSrc().equals(a.getAddress())) {
                    try {
                        b.send(null, "This message would trigger an exception if the channel was not yet connected");
View Full Code Here

TOP

Related Classes of org.jgroups.ReceiverAdapter

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.