我希望一个类在多个其他类中调用相同的方法,而不需要尝试在自身上这样做。
RpcDispatcher 使命感 rsp_list = disp.callRemoteMethods(null, "print", new Object[]{10}, new Class[]{int.class}, opts); 不应尝试调用 print 就其本身而言,只有其他渠道成员。
rsp_list = disp.callRemoteMethods(null, "print", new Object[]{10}, new Class[]{int.class}, opts);
print
您可以在中使用排除列表 RequestOptions 传递给调用,或使用 TransientFlag.DONT_LOOPBACK (首选,因为效率更高)。瞬态标志也设置在 请求选项 .
RequestOptions
TransientFlag.DONT_LOOPBACK
请求选项