/** * When a method is called with "name.meth" * we look up the object with name "name" * and invoke the method "meth". * The method's last parameter MUST be an ISender object * * @param handler the object to handle the RPC calls * @param name the name exposed for this object. RPC calls to "name." * come to this object. */ public void AddHandlerWithSender(string name, object handler) { lock ( _sync ) { IRpcHandler h = new ReflectionRpcHandler(this, handler, true); _method_handlers.Add(name, h); _method_cache.Clear(); } }
/** * When a method is called with "name.meth" * we look up the object with name "name" * and invoke the method "meth". * @param handler the object to handle the RPC calls, if * this is not an IRpcHandler, then method calls are looked up * using .Net reflection: anything after the first "." will be * used to look up the method. If this is an IRpcHandler, the * Handle method will be called when * @param name_space the name exposed for this object. * RPC calls to "<name_space>.<method>" * come to this object. */ public void AddHandler(string name_space, object handler) { lock ( _sync ) { IRpcHandler h = handler as IRpcHandler; if (h == null) { h = new ReflectionRpcHandler(this, handler, false); } _method_handlers.Add(name_space, h); _method_cache.Clear(); } }
/** * When a method is called with "name.meth" * we look up the object with name "name" * and invoke the method "meth". * The method's last parameter MUST be an ISender object * * @param handler the object to handle the RPC calls * @param name the name exposed for this object. RPC calls to "name." * come to this object. */ public void AddHandlerWithSender(string name, object handler) { lock( _sync ) { IRpcHandler h = new ReflectionRpcHandler(this, handler, true); _method_handlers.Add(name, h); _method_cache.Clear(); } }
/** * When a method is called with "name.meth" * we look up the object with name "name" * and invoke the method "meth". * @param handler the object to handle the RPC calls, if * this is not an IRpcHandler, then method calls are looked up * using .Net reflection: anything after the first "." will be * used to look up the method. If this is an IRpcHandler, the * Handle method will be called when * @param name_space the name exposed for this object. * RPC calls to "<name_space>.<method>" * come to this object. */ public void AddHandler(string name_space, object handler) { lock( _sync ) { IRpcHandler h = handler as IRpcHandler; if( h == null ) { h = new ReflectionRpcHandler(this, handler, false); } _method_handlers.Add(name_space, h); _method_cache.Clear(); } }