Package org.jgroups.blocks

Examples of org.jgroups.blocks.MessageDispatcher


        public void run() {
            try {
                c.connect("ChannelConcurrencyTest");
                if(useDispatcher && c.isConnected()) {
                    final MessageDispatcher md=new MessageDispatcher(c, null, null, new MyHandler());
                    for(int i=0;i < 10;i++) {
                        final RspList rsp=md.castMessage(null,
                                                         new Message(null, null, i),
                                                         GroupRequest.GET_ALL,
                                                         2500);
                        for(Object o:rsp.getResults()) {
                            assertEquals("Wrong result received at " + c.getAddress(), i, o);
View Full Code Here


      // register as a listener for nodeid-adress mapping events
      nodeAddressMapListener = new NodeAddressMapListener();

      registerListener(nodeAddressMapListener);

      this.controlMessageDispatcher = new MessageDispatcher(syncChannel, cml, ml, rh, true);

      Receiver r = new DataReceiver();
      asyncChannel.setReceiver(r);

      syncChannel.connect(groupName);
View Full Code Here

     
//      Thread.currentThread().setContextClassLoader(testLoader);   
//      try
//      {
         channel1 = (Channel) factoryMeth.invoke(factory1, factory1Args);
         dispatchers[0] = new MessageDispatcher(channel1, handler, handler, handler);
        
         channel1.connect("leaktest");
         assertEquals("No classloader leak on channel1 connect", null, handler.getLeakedClassLoader());
        
         channel2 = (Channel) factoryMeth.invoke(factory2, factory2Args);
         dispatchers[1] = new MessageDispatcher(channel2, handler, handler, handler);
        
         channel2.connect("leaktest");
         assertEquals("No classloader leak on channel2 connect", null, handler.getLeakedClassLoader());
//      }
//      finally
//      {
//         Thread.currentThread().setContextClassLoader(ours);
//      }
     
      log.info("Channels connected");
     
      ClassLoaderLeakRunner[] runners = new ClassLoaderLeakRunner[numThreads];     
     
      for (int i = 0; i < runners.length; i++)
      {
         MessageDispatcher disp = dispatchers[i % 2];
           
         runners[i] = new ClassLoaderLeakRunner(disp, numLoops, runnerGroup, semaphore);        
      }

      semaphore.acquire(numThreads);
View Full Code Here

  public void test() throws Exception {
   
    logger.info("'org.jgroups.blocks.MessageDispatcher' test");
   
    channel = new JChannel(props);
    disp = new MessageDispatcher(channel, null, null, this);
    channel.connect("MessageDispatcherTestGroup");
   
    logger.info(" -> View Id: " + channel.getView().getViewId());
    logger.info(" -> View Creater: " + channel.getView().getCreator());
    logger.info(" -> View Coordinator: " + channel.getView().getMembers().get(0));
View Full Code Here

    }
    handler = new MyRequestHandler(channel);
    messageListener = new MyMessageListener();
    membershipListener = new MyMembershipListener();
   
    disp = new MessageDispatcher(channel, messageListener, membershipListener, handler);
    channel.connect("MessageDispatcherTestGroup");
   
    Util.sleep(100);
    logger.info("Casting message to all group members");
    Message message = new Message(null, null, new String("MessageDispatcher Test Message"));
View Full Code Here

    public void start() throws Exception {
        channel=new JChannel(props);
        //channel.setOpt(Channel.LOCAL, Boolean.FALSE);
        // disp=new MessageDispatcher(channel, null, null, this);
        disp=new MessageDispatcher(channel, null, null, this,
                false, // deadlock detection is disabled
                true); // concurrent processing is enabled
        channel.connect("MessageDispatcherTestGroup");

//        for(int i=0; i < 10; i++) {
View Full Code Here

        if(debug) {
            debugger=new Debugger((JChannel)channel, cummulative);
            debugger.start();
        }
        //channel.setOpt(Channel.LOCAL, Boolean.FALSE);
        disp=new MessageDispatcher(channel, null, null, this);
        channel.connect("MessageDispatcherTestAsyncGroup");
    }
View Full Code Here

     
      MembershipListener membershipListener = new ControlMembershipListener();
     
      RequestHandler requestHandler = new ControlRequestHandler();
     
      dispatcher = new MessageDispatcher(controlChannel, messageListener, membershipListener, requestHandler, true);
     
      starting = true;
     
      //first kickoff a thread to start the dataChannel
      Future<String> future = connectDataChannel();
View Full Code Here

         {
            public Void run() throws Exception
            {
               channel = new JChannel(configurator);
               channel.setOpt(Channel.AUTO_RECONNECT, true);
               dispatcher = new MessageDispatcher(channel, null, RPCServiceImpl.this, RPCServiceImpl.this);
               channel.connect(clusterName);
               return null;
            }
         });
      }
View Full Code Here

     
      MembershipListener membershipListener = new ControlMembershipListener();
     
      RequestHandler requestHandler = new ControlRequestHandler();
     
      dispatcher = new MessageDispatcher(controlChannel, messageListener, membershipListener, requestHandler, false);
     
      starting = true;
     
      //first kickoff a thread to start the dataChannel
      Future<String> future = connectDataChannel();
View Full Code Here

TOP

Related Classes of org.jgroups.blocks.MessageDispatcher

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.