Package org.jgroups.blocks

Examples of org.jgroups.blocks.MessageDispatcher$ProtocolAdapter


/*     */
/* 134 */     MembershipListener membershipListener = new ControlMembershipListener(null);
/*     */
/* 136 */     RequestHandler requestHandler = new ControlRequestHandler(null);
/*     */
/* 138 */     this.dispatcher = new MessageDispatcher(this.controlChannel, messageListener, membershipListener, requestHandler, true);
/*     */
/* 140 */     Receiver dataReceiver = new DataReceiver(null);
/*     */
/* 142 */     this.dataChannel.setReceiver(dataReceiver);
/*     */
View Full Code Here


   public void configure(String props) throws Exception
   {
      channel_ = new JChannel(props);
      requestHandler_ = new RequestHandlerImpl();
      mdispatcher_ = new MessageDispatcher(channel_, null, null, requestHandler_);
      channel_.setChannelListener(channelListener_);
      channel_.connect("Portal");
   }
View Full Code Here

     
      MembershipListener membershipListener = new ControlMembershipListener();
     
      RequestHandler requestHandler = new ControlRequestHandler();
     
      dispatcher = new MessageDispatcher(controlChannel, messageListener, membershipListener, requestHandler, true);
             
      Receiver dataReceiver = new DataReceiver();
     
      dataChannel.setReceiver(dataReceiver);
     
View Full Code Here

      MessageListenerToRequestHandlerAdapter adapter = new MessageListenerToRequestHandlerAdapter( wrapper );
      dispatcher = new MuxMessageDispatcher( muxId, channel, wrapper, listener, adapter );
    }
    else {
      MessageListenerToRequestHandlerAdapter adapter = new MessageListenerToRequestHandlerAdapter( listener );
      dispatcher = new MessageDispatcher( channel, listener, listener, adapter );
    }

    masterNodeSelector.setLocalAddress( channel.getAddress() );

    if ( !channel.flushSupported() ) {
View Full Code Here

      }

      ClassLoader cl = (ClassLoader) props.get( CLASSLOADER );
      MessageListener wrapper = ( cl != null ) ? new ClassloaderMessageListener( listener, cl ) : listener;
      MessageListenerToRequestHandlerAdapter adapter = new MessageListenerToRequestHandlerAdapter( wrapper );
      MessageDispatcher dispatcher = new MuxMessageDispatcher( muxId, channel, wrapper, listener, adapter );
      sender = new DispatcherMessageSender( dispatcher );
    }
    else {
      MessageListenerToRequestHandlerAdapter adapter = new MessageListenerToRequestHandlerAdapter( listener );
      MessageDispatcher standardDispatcher = new MessageDispatcher( channel, listener, listener, adapter );
      sender = new DispatcherMessageSender( standardDispatcher );
    }

    masterNodeSelector.setLocalAddress( channel.getAddress() );
View Full Code Here

                                             .setValue("leave_timeout",100).setValue("join_timeout", 500)
                                             .setValue("log_view_warnings",false)
                                             .setValue("view_ack_collection_timeout",2000)
                                             .setValue("log_collect_msgs",false));
            channels[i].setName(String.valueOf((i + 1)));
            dispatchers[i]=new MessageDispatcher(channels[i], null, null);
            channels[i].connect("MessageDispatcherRSVPTest");
            System.out.print(i + 1 + " ");
            if(i == 0)
                Util.sleep(1000);
        }
View Full Code Here

                                      new GMS(),
                                      new RSVP().setValue("ack_on_delivery", false)
                                        .setValue("throw_exception_on_timeout", false));
            channels[i].setName(Character.toString((char) ('A' + i)));
            channels[i].setDiscardOwnMessages(true);
            dispatchers[i]=new MessageDispatcher(channels[i], null, null, new MyRequestHandler());
            channels[i].connect("DynamicDiscardTest");
            System.out.print(i + 1 + " ");
        }
        Util.waitUntilAllChannelsHaveSameSize(10000, 1000, channels);
View Full Code Here

    protected void setUp() throws Exception {
        a=createChannel(true, 2, "A");
        GMS gms=(GMS)a.getProtocolStack().findProtocol(GMS.class);
        if(gms != null)
            gms.setPrintLocalAddress(false);
        d1=new MessageDispatcher(a, null, null, null);
        a.connect("MessageDispatcherUnitTest");
    }
View Full Code Here

    public void testNullMessageToAll() throws Exception {
        d1.setRequestHandler(new MyHandler(null));
        b=createChannel(a, "B");
        long stop, start=System.currentTimeMillis();
        d2=new MessageDispatcher(b, null, null, new MyHandler(null));
        stop=System.currentTimeMillis();
        b.connect("MessageDispatcherUnitTest");
        Assert.assertEquals(2,b.getView().size());
        System.out.println("view: " + b.getView());
View Full Code Here

     * Tests MessageDispatcher.castMessageXX() with a message whose destination is not null:
     * https://issues.jboss.org/browse/JGRP-1617
     */
    public void testCastMessageWithNonNullDest() throws Exception {
        b=createChannel(a, "B");
        d2=new MessageDispatcher(b, null, null, null);
        b.connect("MessageDispatcherUnitTest");
        Util.waitUntilAllChannelsHaveSameSize(10000, 1000, a, b);

        d1.setRequestHandler(new MyHandler(new byte[]{'d', '1'}));
        d2.setRequestHandler(new MyHandler(new byte[]{'d', '2'}));
View Full Code Here

TOP

Related Classes of org.jgroups.blocks.MessageDispatcher$ProtocolAdapter

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.