Package org.jgroups.blocks

Examples of org.jgroups.blocks.RpcDispatcher


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

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

        Channel c2 = createChannel("A");
        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;

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

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

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

            spurious_channel_created=true;
        }

        channel.addChannelListener(this);
        channel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE);
        disp=new RpcDispatcher(channel, null, this, this,
                               false, // deadlock detection is disabled
                               true); // concurrent processing is enabled
        channel.connect("MessageDispatcherTestGroup");
        mainLoop();
    }
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


    public void start(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

        int     c;
        RspList rsps;

        channel=new JChannel(); // default props
        channel.setOpt(Channel.AUTO_RECONNECT, true);
        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

    Handler handler = new Handler();
    InRpc in_rpc = new InRpc();

    try {
        channel = new JChannel(stack);
        disp = new RpcDispatcher(channel, handler, handler, in_rpc, use_deadlock_detection);
        channel.connect(name);
    }
        catch(ChannelClosedException ex) { ex.printStackTrace(); }
        catch(ChannelException ex) { ex.printStackTrace(); }
   
View Full Code Here

        c1.setOpt(Channel.AUTO_GETSTATE, false);
        c1.addChannelListener(new BelasChannelListener("C1"));
        c2=createChannel();
        c2.setOpt(Channel.AUTO_GETSTATE, false);
        c2.addChannelListener(new BelasChannelListener("C2"));
        disp1=new RpcDispatcher(c1, null, new BelasReceiver("C1"), this);
        disp2=new RpcDispatcher(c2, null, new BelasReceiver("C2"), this);
        c1.connect("demo");
        c2.connect("demo");
        assertEquals(2, c1.getView().size());

        RspList rsps=disp2.callRemoteMethods(null, "getCurrentTime", null, (Class[])null, GroupRequest.GET_ALL, 10000);
View Full Code Here

    private void start(String props) throws IOException, ChannelException {
        channel=new JChannel(props);
        channel.addChannelListener(this);
        channel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE);
        disp=new RpcDispatcher(channel, null, this, this,
                false, // deadlock detection is disabled
                true); // concurrent processing is enabled
        channel.connect("MessageDispatcherTestGroup");
        mainLoop();
    }
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.