Package org.jgroups.blocks

Examples of org.jgroups.blocks.MethodCall


    }


    public static void testInheritanceTYPES() throws Throwable {

        MethodCall methodCall = new MethodCall("someMethod",
                                               new Object[] { "abc" },
                                               new Class[] { String.class });

        TargetSubclass target = new TargetSubclass();
        Object result = methodCall.invoke(target);
        Assert.assertEquals("ABC", result);
    }
View Full Code Here


    /**
     * This tests whether overriden methods are correctly identified and invoked.
     */
    public static void testOverriddenForTYPES() throws Throwable  {

        MethodCall methodCall = new MethodCall("overriddenMethod",
                                               new Object[] { "abc" },
                                               new Class[] { String.class });

        TargetSubclass target = new TargetSubclass();
        Object result = methodCall.invoke(target);
        Assert.assertEquals("TargetSubclassABC", result);

    }
View Full Code Here

    }


    public static void testNoArgumentMethodForTYPES() throws Throwable  {

        MethodCall methodCall = new MethodCall("noArgumentMethod", new Object[0], new Class[0]);

        TargetSubclass target = new TargetSubclass();
        Object result = methodCall.invoke(target);
        Assert.assertEquals("noArgumentMethodResult", result);

    }
View Full Code Here



    public static void testSIGNATURE() throws Throwable {

        MethodCall methodCall = new MethodCall("someMethod",
                                               new Object[] { "abc" },
                                               new String[] { "java.lang.String" });

        Target target = new Target();
        Object result = methodCall.invoke(target);
        Assert.assertEquals("ABC", result);
    }
View Full Code Here

        Assert.assertEquals("ABC", result);
    }


    public static void testInheritanceSIGNATURE() throws Throwable {
        MethodCall methodCall = new MethodCall("someMethod",
                                               new Object[] { "abc" },
                                               new String[] { "java.lang.String" });

        TargetSubclass target = new TargetSubclass();
        Object result = methodCall.invoke(target);
        Assert.assertEquals("ABC", result);
    }
View Full Code Here

    }



    public static void testMarshalling() throws Exception {
        MethodCall methodCall = new MethodCall("someMethod",
                                               new Object[] { "abc" },
                                               new String[] { "java.lang.String" });
        methodCall.put("name", "Bela");
        methodCall.put("id", new Integer(322649));

        System.out.println("methodCall: " + methodCall);

        MethodCall m=marshalAndUnmarshal(methodCall);
        System.out.println("m: " + m);
        Assert.assertEquals(m.get("name"), "Bela");
        Assert.assertEquals(m.get("id"), new Integer(322649));
    }
View Full Code Here

    disp = new RpcDispatcher(channel, messageListener, membershipListener, rpcMethods);
    channel.connect("RpcDispatcherContentTestGroup");
   
    Util.sleep(1000);
    String param = channel.getName();
    MethodCall call = new MethodCall("getNodeName", new Object[]{param}, new Class[]{String.class});
    logger.info("Call all members getNodeName()");
    RequestOptions requestOptions = new RequestOptions(ResponseMode.GET_ALL, 0);
   
    System.out.println("Responses:");
    List<String> list = rsp_list.getResults();
View Full Code Here

    disp = new RpcDispatcher(channel, messageListener, membershipListener, rpcMethods);
    channel.connect("RspFilterTestGroup");
   
    Util.sleep(1000);
    String param = channel.getName();
    MethodCall call = new MethodCall("getNodeName", new Object[]{param}, new Class[]{String.class});
    logger.info("Call all members getNodeName()");
    RequestOptions requestOptions = new RequestOptions(ResponseMode.GET_ALL, 0, false, new MyRspFilter());   
    rsp_list = disp.callRemoteMethods(null, call, requestOptions);
   
    System.out.println("Responses:");
View Full Code Here

      String viewId = null;
      if(null != channel.getView()) {
        viewId = channel.getView().getViewId().toString();
      }
      Content content = new Content(i, 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);
     
      showRspList(rsp_list);
    }
View Full Code Here

      String viewId = null;
      if(null != channel.getView()) {
        viewId = channel.getView().getViewId().toString();
      }
      Content content = new Content(i, channel.getName(), viewId);
      MethodCall call = new MethodCall("updateContent", new Object[]{content}, new Class[]{Content.class});
      logger.info("Call all group members updatecontent method: " + content);
     
      NotifyingFuture<RspList<Content>> future = disp.callRemoteMethodsWithFuture(null, call, requestOptions);
     
      Util.sleep(1000);
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.