Package org.jgroups.blocks

Examples of org.jgroups.blocks.MessageDispatcher$ProtocolAdapter


  private void prepareJGroupsChannel() throws Exception {
    channel = new JChannel( ConfigurationParseHelper.locateConfig( "testing-flush-loopback.xml" ) );
    channel.connect( CHANNEL_NAME );
    JGroupsReceiver listener = new JGroupsReceiver(getSearchFactoryImpl());
    MessageListenerToRequestHandlerAdapter adapter = new MessageListenerToRequestHandlerAdapter( listener );
    MessageDispatcher standardDispatcher = new MessageDispatcher( channel, listener, listener, adapter );
  }
View Full Code Here


            channel = new JChannel(channelConfig);

            channel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE);
            channel.setOpt(Channel.AUTO_GETSTATE, Boolean.TRUE);

            dispatcher = new MessageDispatcher(channel, null, null, null);

            dispatcher.setRequestHandler(this);
            dispatcher.setMembershipListener(this);
         }
      }
View Full Code Here

            channel = new JChannel(channelConfig);

            channel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE);
            channel.setOpt(Channel.AUTO_GETSTATE, Boolean.TRUE);

            dispatcher = new MessageDispatcher(channel, null, null, null);

            dispatcher.setRequestHandler(this);
            dispatcher.setMembershipListener(this);
         }
      }
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 {
      // TODO -- perhaps port previous multi-handling?
      channel.setReceiver( listener );
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

         SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>()
         {
            public Void run() throws Exception
            {
               channel = createChannel();
               dispatcher = new MessageDispatcher(channel, null, AbstractRPCService.this, AbstractRPCService.this);
               channel.connect(clusterName);
               return null;
            }
         });
      }
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

            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

    this.id = id;
    this.context = context;
    this.stateful = stateful;
    this.membershipListener = membershipListener;
   
    this.dispatcher = new MessageDispatcher(channel, this, this, this);
    this.timeout = timeout;
  }
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

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.