Exemple #1
0
		protected void DoRequest(Request request)
		{
			try
			{
				pool.Request(request);
			}
			catch(Exception e)
			{
				
			}
		}
Exemple #2
0
		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);
		}
Exemple #6
0
 public Param1 GetValueComplex()
 {
     Request request = new Request("My Service", "GetValueSimple", null);
     return pool.Request<Param1>(request);
 }
Exemple #7
0
 public int GetValueSimple()
 {
     Request request = new Request("My Service", "GetValueSimple", null);
     return pool.Request<int>(request);
 }
Exemple #8
0
 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);
 }
Exemple #9
0
 public bool SetValue(int newValue, Param1 param)
 {
     Request request = new Request("My Service", "SetValue", new object[] {newValue, param });
     return pool.Request<bool>(request);
 }