Beispiel #1
0
		protected void DoRequest(Request request)
		{
			try
			{
				pool.Request(request);
			}
			catch(Exception e)
			{
				
			}
		}
Beispiel #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)
			{
                
			}
		}
Beispiel #3
0
		public void BeginRequest(Request request, WaitCallback callback, object context)
		{
			pool.BeginRequest(request, callback, context);
		}
Beispiel #4
0
		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;
		}
Beispiel #5
0
		public void Request(Request request)
		{
			pool.Request(request);
		}
Beispiel #6
0
 public Param1 GetValueComplex()
 {
     Request request = new Request("My Service", "GetValueSimple", null);
     return pool.Request<Param1>(request);
 }
Beispiel #7
0
 public int GetValueSimple()
 {
     Request request = new Request("My Service", "GetValueSimple", null);
     return pool.Request<int>(request);
 }
Beispiel #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);
 }
Beispiel #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);
 }