[Javagroups-development] Proposal: Rewrite MethodCall and change RpcDispatcher
Brought to you by:
belaban
From: Filip H. <ma...@fi...> - 2002-04-08 23:48:40
|
Okey guys, I'm helping a friend debug his work with JavaGroups and came across a pretty fundamental bug in the RpcDispatcher and the MethodCall classes. The current implementation of MethodCall truncates null arguments, which means that it invokes the wrong method, and it makes it impossible to invoke a method with null arguments. for example: void myMethod(MyClass arg1, MyClass arg2) - we refer to this one as method 1 void myMethod(MyClass arg1) - we refer to this one as method 2 if I call RpcDispatcher.callRemoteMethod(addr,"myMethod",new MyClass(),null,GroupRequest.GET_ALL,10000); This is actually going to invoke method 2 instead of method 1. Here is my proposal: 1. Deprecate the current callRemoteMethod(addr, name, arg1, arg2,...,argN, mode, timeout) and implement a new one callRemoteMethod(addr,name,Class[] argClasses, Object[] args, mode, timeout) 2. Deprecate the MethodCall(name, arg1, arg2,...,argN) methods and the MethodCall(name, Object[] args) method Implement a new constructor MethodCall(name, Class[] argClasses, Object[] args) this should take care of the invocation of null arguments. what ya say? Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect fi...@fi... www.filip.net |