use of org.jgroups.blocks.MethodCall in project JGroups by belaban.
the class MethodCallTest method testMarshalling.
public static void testMarshalling() throws Exception {
MethodCall methodCall = new MethodCall("someMethod", new Object[] { "abc" }, new Class[] { String.class });
System.out.println("methodCall: " + methodCall);
MethodCall m = marshalAndUnmarshal(methodCall);
System.out.println("m: " + m);
}
use of org.jgroups.blocks.MethodCall in project JGroups by belaban.
the class MethodCallTest method testSignature.
public void testSignature() throws Exception {
MethodCall mc = new MethodCall("foo", new Object[] { 35, "Bela" }, new Class[] { int.class, String.class });
Assert.assertEquals(mc.invoke(target), Boolean.TRUE);
}
use of org.jgroups.blocks.MethodCall in project JGroups by belaban.
the class MethodCallTest method testMethod2.
public void testMethod2() throws Exception {
MethodCall call = new MethodCall(CALL, true, Boolean.FALSE, 322649, 3.24, (float) 54.345, new byte[] { 'b', 'e', 'l', 'a' }, new String[] { "Bela", "Michelle" });
call.invoke(this);
}
use of org.jgroups.blocks.MethodCall in project JGroups by belaban.
the class MethodCallTest method testBufferSize.
public static void testBufferSize() throws Exception {
MethodCall m = new MethodCall("foo", new Object[] { 10, "Bela" }, new Class[] { int.class, String.class });
byte[] data = Util.objectToByteBuffer(m);
MethodCall m2 = Util.objectFromByteBuffer(data);
System.out.println(m2);
Object[] args = m2.args();
assert args.length == 2;
assert args[0].equals(10);
assert args[1].equals("Bela");
}
use of org.jgroups.blocks.MethodCall in project JGroups by belaban.
the class GraphPanel method start.
public void start(String name) {
myname = name;
int xloc = (int) (10 + 250 * Math.random());
int yloc = (int) (10 + 250 * Math.random());
try {
MethodCall call = new MethodCall("addNode", new Object[] { name, my_addr, Integer.valueOf(xloc), Integer.valueOf(yloc) }, new Class[] { String.class, Address.class, int.class, int.class });
wb.disp.callRemoteMethods(null, call, new RequestOptions(ResponseMode.GET_ALL, 0));
} catch (Exception e) {
log.error(e.toString());
}
repaint();
}
Aggregations