Package org.jgroups.blocks

Examples of org.jgroups.blocks.MessageDispatcher$ProtocolAdapter


     
      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


     
//      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 start() throws Exception {
        channel=new JChannel(props);
       //  channel.setOpt(Channel.LOCAL, Boolean.FALSE); // do not receive my own messages
        disp=new MessageDispatcher(channel, null, this, this, false);
        channel.connect("MessageDispatcherSpeedTestGroup");

        try {
            if(server) {
                System.out.println("-- Started as server. Press ctrl-c to kill");
View Full Code Here

    public ChannelCommandDispatcherFactory(ChannelCommandDispatcherFactoryConfiguration config) {
        this.nodeFactory = config.getNodeFactory();
        this.marshallingContext = config.getMarshallingContext();
        this.timeout = config.getTimeout();
        final RpcDispatcher.Marshaller marshaller = new CommandResponseMarshaller(this.marshallingContext);
        this.dispatcher = new MessageDispatcher() {
            @Override
            protected RequestCorrelator createRequestCorrelator(Protocol transport, RequestHandler handler, Address localAddr) {
                RequestCorrelator correlator = super.createRequestCorrelator(transport, handler, localAddr);
                correlator.setMarshaller(marshaller);
                return correlator;
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

            JChannelFactory channelFactory = new JChannelFactory(props);
            clusterChannel = (JChannel) channelFactory.createChannel();
            // Disable delivery of messages we send to ourself.
            clusterChannel.setOpt(Channel.LOCAL, Boolean.FALSE);
            //clusterChannel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE);
            broadcastDispatcher = new MessageDispatcher(clusterChannel, null, clusterMembershipListener, this);
            clusterChannel.connect(clusterId);
        }
        catch (ChannelException cex)
        {          
            ClusterException cx = new ClusterException();
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

      muxId = n;
      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 {
      // TODO -- perhaps port previous multi-handling?
      channel.setReceiver( listener );
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

      }

      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

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.