Package org.jgroups.blocks

Examples of org.jgroups.blocks.RpcDispatcher


    public void start(String props, int num_threads, long interval, boolean discard_local) throws Exception {
        channel=new JChannel(props);
        if(discard_local)
            channel.setOpt(Channel.LOCAL, Boolean.FALSE);
        disp=new RpcDispatcher(channel, null, this, this);
        channel.connect("RpcDispatcherStressTestGroup");

        threads=new Publisher[num_threads];
        results=new int[num_threads];
        for(int i=0; i < threads.length; i++) {
View Full Code Here


        System.out.println("properties are " + props);

        try {
            channel = new JChannel(props);
            disp = new RpcDispatcher(channel, this, this, this);
            channel.connect(groupname);
            channel.getState(null, 0);
        } catch (Exception e) {
            log.error("Whiteboard.init(): " + e);
        }
View Full Code Here

      log.warn("Starting cache");
      cache.start();
      // now remove the existing RpcDispatcher and replace with one that is a noop.
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
      RPCManager rpcManager = cr.getComponent(RPCManager.class);
      RpcDispatcher d = (RpcDispatcher) TestingUtil.extractField(rpcManager, "rpcDispatcher");
      d.stop();
      RpcDispatcher replacement = new NoopDispatcher();
      replacement.setRequestMarshaller(d.getRequestMarshaller());
      replacement.setResponseMarshaller(d.getResponseMarshaller());
      ReflectionUtil.setValue(rpcManager, "rpcDispatcher", replacement);

      long duration = System.currentTimeMillis() - startTime;
      log.warn("Started cache.  " + printDuration(duration));
   }
View Full Code Here

    public void start() throws Exception {
        int     c;
        RspList rsps;

        channel=new JChannel(); // default props
        disp=new RpcDispatcher(channel, null, this, this);
        channel.connect("rpc-test");
       
        while(true) {
            System.out.println("[x]: exit [s]: send sync group RPC");
            System.out.flush();
View Full Code Here


    public void start() {
    try {
        channel = new JChannel();
        disp = new RpcDispatcher(channel, null, null, this);
        channel.connect(name);
    }
        catch(ChannelClosedException ex) { ex.printStackTrace(); }
        catch(ChannelException ex) { ex.printStackTrace(); }
View Full Code Here

    public void start(String props, String name) throws Exception {
        ch=new JChannel(props);
        if(name != null)
            ch.setName(name);
        disp=new RpcDispatcher(ch, null, this, this);
        ch.connect("RelayDemo");
        local_addr=ch.getAddress();

        MethodCall call=new MethodCall(getClass().getMethod("handleMessage", String.class, Address.class));
        for(;;) {
View Full Code Here

  colors.put(new Integer(7),  Color.cyan);
  colors.put(new Integer(8),  Color.blue);
  mythread=new Thread(this);
  try {
      channel=new JChannel();
      dispatcher=new RpcDispatcher(channel, null, null, this);
      channel.connect(groupname);
  }
  catch(Exception e) {
      System.err.println(e);
      System.exit(0);
View Full Code Here

        int num_expected_msgs=num_threads * num_msgs * buddies;
        int num_total_msgs=num_channels * num_threads * num_msgs; // over all channels
        for(int i=0; i < channels.length; i++) {
            channels[i]=new JChannel(props);
            receivers[i]=new Receiver(terminate_barrier, bytes_received, msgs_received, num_expected_msgs, num_total_msgs);
            dispatchers[i]=new RpcDispatcher(channels[i], null, null, receivers[i]);
            channels[i].connect("x");
        }

        // start the senders
        for(int i=0; i < channels.length; i++) {
View Full Code Here

    private void start() throws ChannelException {
        ch=new JChannel(props);
        if(logical_name != null)
            ch.setName(logical_name);
        disp=new RpcDispatcher(ch, null, this, this);
        loop();
        ch.close();
    }
View Full Code Here

    public void start(String props, int num_threads, long interval, boolean discard_local) throws Exception {
        channel=new JChannel(props);
        if(discard_local)
            channel.setOpt(Channel.LOCAL, Boolean.FALSE);
        disp=new RpcDispatcher(channel, null, this, this);
        channel.connect("RpcDispatcherStressTestGroup");

        threads=new Publisher[num_threads];
        results=new int[num_threads];
        for(int i=0; i < threads.length; i++) {
View Full Code Here

TOP

Related Classes of org.jgroups.blocks.RpcDispatcher

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.