Package org.jgroups.blocks

Examples of org.jgroups.blocks.MethodCall


    String viewId = null;
    if(null != channel.getView()) {
      viewId = channel.getView().getViewId().toString();
    }
    Content content = new Content(1, channel.getName(), viewId);
    MethodCall call = new MethodCall("updateContent", new Object[]{content}, new Class[]{Content.class});
    logger.info("Call all group members updatecontent method: " + content);
    rsp_list = disp.callRemoteMethods(null, call, requestOptions);
   
    System.out.println("Responses:");
    List<Content> list = rsp_list.getResults();
View Full Code Here


    logger.info(" -> View Id: " + channel.getView().getViewId());
    logger.info(" -> View Creater: " + channel.getView().getCreator());
    logger.info(" -> View Coordinator: " + channel.getView().getMembers().get(0));
    logger.info(" -> View Memembers: " + channel.getView().getMembers() + "\n");
   
    MethodCall method_call = new MethodCall("getUser", new Object[]{101, "RPC remote test", new User(1000, "Kylin Soong", "IT")}, new Class[]{int.class, String.class, User.class});
   
//    String methodName = RpcDispatcherTest.class.getMethod("getUser", new Class[] {int.class, String.class, User.class}).getName();
//    System.out.println(methodName);
   
    for (int i = 0; i < 5; i++){
View Full Code Here

                }
                else {
                    try {

                            if(log.isInfoEnabled()) log.info("sending LEAVE request to " + coord);
                        MethodCall call = new MethodCall("handleLeave", new Object[] {mbr, Boolean.FALSE},
                            new String[] {Address.class.getName(), boolean.class.getName()});
                        gms.callRemoteMethod(coord, call, GroupRequest.GET_NONE, 0)// asynchronous
                    }
                    catch(Exception e) {
                    }
View Full Code Here

  /* Call the handleFlush() method of all existing members. The highest seqnos seen by the coord
     is the argument */
   if(log.isInfoEnabled()) log.info("calling handleFlush(" + dests + ')');
  passDown(new Event(Event.SWITCH_OUT_OF_BAND)); // we need out-of-band control for FLUSH ...
  MethodCall call = new MethodCall("handleFlush", new Object[] {dests, highest_delivered_msgs.clone()},
    new String[] {Vector.class.getName(), long[].class.getName()});
  rsp_list=callRemoteMethods(dests, call, GroupRequest.GET_ALL, 0);
   if(log.isInfoEnabled()) log.info("flush done");


View Full Code Here

            }

            synchronized(view_installation_mutex) {
                try {
                    if(log.isInfoEnabled()) log.info("sending handleJoin() to " + coord);
                    MethodCall call=new MethodCall("handleJoin", new Object[]{mbr}, new Class[]{Address.class});
                    gms.callRemoteMethod(coord, call, GroupRequest.GET_NONE, 0);
                    view_installation_mutex.wait(gms.join_timeout)// wait for view -> handleView()
                }
                catch(Exception e) {
                    if(log.isErrorEnabled()) log.error("exception is " + e);
View Full Code Here

        serverObject.setRpcDispatcher(disp);
        channel.connect(name);
        Address localAddress = channel.getLocalAddress();

        // call the nested group method on itself
        MethodCall call = new MethodCall("outerMethod", new Object[0], new Class[0]);
        log("calling outerMethod() on all members");
        RspList rspList = disp.callRemoteMethods(null, call, GroupRequest.GET_ALL, 0);
        log("results of outerMethod(): " + rspList);

        assertEquals(1, rspList.size());
View Full Code Here

        c2.connect(name);
        Address localAddress2 = c2.getLocalAddress();

        try {
            // call a point-to-point method on Member 2 that triggers a nested distributed RPC
            MethodCall call = new MethodCall("outerMethod", new Object[0], new Class[0]);
            log("calling outerMethod() on " + localAddress2);
            Object retval = disp1.callRemoteMethod(localAddress2, call, GroupRequest.GET_ALL, 0);
            log("results of outerMethod(): " + retval);
        }
        finally {
View Full Code Here

        dests.add(c1.getLocalAddress());
        dests.add(c2.getLocalAddress());

        try {
            // call a point-to-point method on Member 2 that triggers a nested distributed RPC
            MethodCall call = new MethodCall("outerMethod", new Object[0], new Class[0]);
            log("calling outerMethod() on all members");
            RspList rsps = disp1.callRemoteMethods(dests, call, GroupRequest.GET_ALL, 0);
            log("results of outerMethod():\n" + rsps);
            assertEquals(2, rsps.size());
        }
View Full Code Here

            this.disp = rpcDispatcher;
        }

        public String outerMethod() {
            log("**** outerMethod() received, calling innerMethod() on all members");
            MethodCall call = new MethodCall("innerMethod", new Object[0], new Class[0]);
            // RspList rspList = disp.callRemoteMethods(null, call, GroupRequest.GET_ALL, 5000);
            RspList rspList = disp.callRemoteMethods(null, call, GroupRequest.GET_ALL, 0);
            Vector results = rspList.getResults();
            log("results of calling innerMethod():\n" + rspList);
            StringBuffer sb = new StringBuffer("outerMethod[");
View Full Code Here

    }


    public void testOld() {
        try {
            MethodCall mc=new MethodCall("foo", new Object[]{new Integer(22), "Bela"});
            assertEquals(mc.invoke(this), Boolean.TRUE);
        }
        catch(Throwable t) {
            fail(t.toString());
        }
    }
View Full Code Here

TOP

Related Classes of org.jgroups.blocks.MethodCall

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.