Example #1
0
        private ITestInterface GetInvocationHelper(ReturnPolicy returnPolicy = ReturnPolicy.TwoWay)
        {
            RemoteExecutionPolicies policies = new RemoteExecutionPolicies(typeof(ITestInterface), returnPolicy);
            var subject = new RemoteCallInterceptor(_oneWayInterceptor, _twoWayInterceptor, policies);

            return((ITestInterface) new ProxyFactory(typeof(ITestInterface), subject).GetProxy());
        }
Example #2
0
        public T Create <T>(ReturnPolicy noResultMethodExcecution)
        {
            RemoteExecutionPolicies policies = new RemoteExecutionPolicies(typeof(T), noResultMethodExcecution);
            var remoteCallInterceptor        = new RemoteCallInterceptor(
                new OneWayRemoteCallInterceptor(_channel, _messageFactory, typeof(T).Name),
                new TwoWayRemoteCallInterceptor(_channel, _dispatcher, _messageFactory, typeof(T).Name, policies), policies);

            var factory = new ProxyFactory(typeof(T), remoteCallInterceptor);

            return((T)factory.GetProxy());
        }
Example #3
0
 public TestableTwoWayRemoteCallInterceptor(IOutputChannel channel, IMessageDispatcher dispatcher, IResponseHandler responseHandler, string interfaceName, RemoteExecutionPolicies policies)
     : base(channel, dispatcher, new DefaultMessageFactory(), interfaceName, policies)
 {
     _responseHandler = responseHandler;
 }