Package org.jgroups.blocks

Examples of org.jgroups.blocks.RpcDispatcher


    public void testTwoChannels() throws Throwable {
        ServerObject obj1, obj2 = null;

        JChannel c1 = new JChannel();
        obj1 = new ServerObject("obj1");
        RpcDispatcher disp1=new RpcDispatcher(c1, null, null, obj1, DEADLOCK_DETECTION);
        obj1.setRpcDispatcher(disp1);
        c1.connect(name);

        JChannel c2 = new JChannel();
        obj2 = new ServerObject("obj2");
        RpcDispatcher disp2=new RpcDispatcher(c2, null, null, obj2, DEADLOCK_DETECTION);
        obj2.setRpcDispatcher(disp2);
        c2.connect(name);
        Address localAddress2 = c2.getLocalAddress();

        try {
View Full Code Here


    public void testTwoChannelsWithInitialMulticast() throws Exception {
        ServerObject obj1, obj2 = null;

        JChannel c1 = new JChannel();
        obj1 = new ServerObject("obj1");
        RpcDispatcher disp1=new RpcDispatcher(c1, null, null, obj1, DEADLOCK_DETECTION);
        obj1.setRpcDispatcher(disp1);
        c1.connect(name);

        JChannel c2 = new JChannel();
        obj2 = new ServerObject("obj2");
        RpcDispatcher disp2=new RpcDispatcher(c2, null, null, obj2, DEADLOCK_DETECTION);
        obj2.setRpcDispatcher(disp2);
        c2.connect(name);

        Vector dests=new Vector();
        dests.add(c1.getLocalAddress());
View Full Code Here

            throws Exception
      {
         super(name, factory);
         if (useDispatcher)
         {
            dispatcher = new RpcDispatcher(channel, this, this, this);
         }
         else
         {
            channel.setReceiver(this);
         }
View Full Code Here

        ch = new JChannel(CHANNEL_PROPS);
        ch.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE);
        ch.setOpt(Channel.AUTO_GETSTATE, Boolean.TRUE);
        ch.setOpt(Channel.BLOCK, Boolean.TRUE);
        if (useDispacher) {
          RpcDispatcher disp = new RpcDispatcher(ch, this, this, this);
        } else if (!usePullMode) {
          ch.setReceiver(this);
        }
        ch.connect("transfer");       
      } catch (Exception e) {
View Full Code Here

                "pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true):" +
                "pbcast.STATE_TRANSFER";
        try {
            channel = new JChannel(props);
            HammerListener listener = new HammerListener();
            new RpcDispatcher(channel, null, listener, listener);
            channel.connect("BOSGroup");

        }             
        catch (org.jgroups.ChannelException ce) {
            System.err.println("Channel Error"+ ce);
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

        // preload all the static ip's, we only do this once, of course

        try {
            channel = new JChannel(props);
      System.out.println(channel.getProtocolStack().printProtocolSpec(false));
            disp = new RpcDispatcher(channel, null, null, null);
            channel.connect("BOSGroup");
        }
        catch (org.jgroups.ChannelException ce) {
            System.err.println("Channel Error"+ ce);
        }
View Full Code Here


    public void start(String props, int num, long interval) throws Exception {
        channel=new JChannel(props);
        channel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE);
        disp=new RpcDispatcher(channel, null, null, this);
        channel.connect("RpcDispatcherTestGroup");

        for(int i=0; i < num; i++) {
            Util.sleep(interval);
            rsp_list=disp.callRemoteMethods(null, "print", new Object[]{new Integer(i)},
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() throws Exception {
        channel=new JChannel(props);
        channel.setOpt(Channel.LOCAL, Boolean.FALSE);
        disp=new RpcDispatcher(channel, null, this, this,
                false, // no deadlock detection
                false); // no concurrent processing on incoming method calls
        // disp.setConcurrentProcessing(true);

        disp.setMethodLookup(new MethodLookup() {
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.