Examples of MethodCall


Examples of org.jgroups.blocks.MethodCall

      dispose();
      return;
  }

  try {
    MethodCall call = new MethodCall("displayMessage", new Object[] {sender, retval},
      new String[] {String.class.getName(), String.class.getName()});
      if(command.equals("Send"))
      disp.callRemoteMethod(dest.addr, call, GroupRequest.GET_FIRST, 0);
      else if(command.equals("Send to all"))
      disp.callRemoteMethods(null, call, GroupRequest.GET_ALL, 0);
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

    proxyEventDistributor = (EventDistributor) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {EventDistributor.class}, new InvocationHandler() {
     
      @Override
      public Object invoke(Object proxy, Method method, Object[] args)
          throws Throwable {
        rpcDispatcher.callRemoteMethods(members, new MethodCall(method, args), GroupRequest.GET_NONE, 0);
        return null;
      }
    });
    //wrap the local in a proxy to prevent unintended methods from being called
    rpcDispatcher = new RpcDispatcher(channel, this, this, Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {EventDistributor.class}, new InvocationHandler() {
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

    final TargetClass target=new TargetClass();


    public void testOld() {
        try {
            MethodCall mc=new MethodCall("foo", new Object[]{new Integer(22), "Bela"}, new Class[]{int.class,String.class});
            Assert.assertEquals(mc.invoke(target), Boolean.TRUE);
        }
        catch(Throwable t) {
            assert false : t.toString();
        }
    }
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

    }


    public void testOld2() {
        try {
            MethodCall mc=new MethodCall("bar", new Object[]{new String[]{"one", "two", "three"}, "Bela"},
                                         new Class[]{String[].class, String.class});
            mc.invoke(target);
        }
        catch(Throwable t) {
            assert false : t.toString();
        }
    }
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

    }


    public void testWithNull() {
        try {
            MethodCall mc=new MethodCall("foobar", null, (Class[])null);
            System.out.println("mc: " + mc);
            mc.invoke(target);
        }
        catch(Throwable t) {
            assert false : t.toString();
        }
    }
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

    }


    public void testOldWithNull() {
        try {
            MethodCall mc=new MethodCall("bar", new Object[]{new String[]{"one", "two", "three"}, null},
                                         new Class[]{String[].class, String.class});
            mc.invoke(target);
        }
        catch(Throwable t) {
            assert false : t.toString();
        }
    }
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

    }


    public void testOldWithNull2() {
        try {
            MethodCall mc=new MethodCall("bar", new Object[]{null, "Bela"},
                                         new Class[]{String[].class, String.class});
            mc.invoke(target);
        }
        catch(Throwable t) {
            assert false : t.toString();
        }
    }
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

    }


    public void testOldWithNull3() {
        try {
            MethodCall mc=new MethodCall("foobar", null, (Class[])null);
            mc.invoke(target);
        }
        catch(Throwable t) {
            assert false : t.toString();
        }
    }
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

    }


    public void testOldWithNull4() {
        try {
            MethodCall mc=new MethodCall("foobar", new Object[0], (Class[])null);
            mc.invoke(target);
        }
        catch(Throwable t) {
            assert false : t.toString();
        }
    }
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

    public void testMethod() {
        Method m;
        try {
            m=TargetClass.class.getMethod("foo", new Class[]{int.class, String.class});
            MethodCall mc=new MethodCall(m, new Object[]{new Integer(22), "Bela"});
            Assert.assertEquals(mc.invoke(target), Boolean.TRUE);
        }
        catch(Throwable t) {
            assert false : t.toString();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.