protected void DoRequest(Request request) { try { pool.Request(request); } catch(Exception e) { } }
protected void DoRequest(Request request, WaitCallback callback, object context) { if (callback == null) { DoRequest(request); return; } try { pool.BeginRequest(request, callback, context); } catch (Exception e) { } }
public void BeginRequest(Request request, WaitCallback callback, object context) { pool.BeginRequest(request, callback, context); }
internal Response Excute(Request request) { var response = new Response { Id = request.Id }; var methodDescriptionBuilder = request.RequestDescription; IExecutor executor = null; servicesLock.EnterReadLock(); try { methodMaps.TryGetValue(methodDescriptionBuilder, out executor); } finally { servicesLock.ExitReadLock(); } if (executor == null) { response.ResultException = new MethodNotFoundException(request.ServiceName, request.ReceiverMethod); return response; } try { response.Result = executor.Execute(request.Parameters); } catch (Exception e) { executorLog.WriteLog("Exception when invoke type : " + executor.GetType().FullName + ", with exception: " + e); response.ResultException = new MethodInvokingException(executor.GetType().FullName, request.ReceiverMethod, e); return response; } return response; }
public void Request(Request request) { pool.Request(request); }
public Param1 GetValueComplex() { Request request = new Request("My Service", "GetValueSimple", null); return pool.Request<Param1>(request); }
public int GetValueSimple() { Request request = new Request("My Service", "GetValueSimple", null); return pool.Request<int>(request); }
public void SetValue(int newValue, Param1 param, WaitCallback CallbackMethod, object context) { Request request = new Request("My Service", "SetValue", new object[] { newValue, param }); pool.BeginRequest(request, CallbackMethod, context); }
public bool SetValue(int newValue, Param1 param) { Request request = new Request("My Service", "SetValue", new object[] {newValue, param }); return pool.Request<bool>(request); }