Example #1
0
 internal ChainTable2PSharpProxy(MachineId callerMachineId, MachineId hostMachineId, IChainTable2 original)
 {
     this.callerMachineId    = callerMachineId;
     this.hostMachineId      = hostMachineId;
     nonannotatableCallProxy = PSharpRealProxy.MakeTransparentProxy(callerMachineId, hostMachineId, original,
                                                                    null, () => new TableNonannotatableCallEvent());
     annotatableCallProxy = PSharpRealProxy.MakeTransparentProxy(callerMachineId, hostMachineId, original,
                                                                 null, () => new TableAnnotatableCallEvent());
 }
Example #2
0
 internal ChainTable2PSharpProxy(MachineId callerMachineId, MachineId hostMachineId,
                                 IChainTable2 original, string debugName)
 {
     this.callerMachineId = callerMachineId;
     this.hostMachineId   = hostMachineId;
     this.debugName       = debugName;
     plainEventProxy      = PSharpRealProxy.MakeTransparentProxy(callerMachineId, hostMachineId, original,
                                                                 debugName, () => new GenericDispatchableEvent());
     tableCallEventProxy = PSharpRealProxy.MakeTransparentProxy(callerMachineId, hostMachineId, original,
                                                                debugName, () => new TableCallEvent());
 }
Example #3
0
        public override async Task <IQueryStream <TElement> > ExecuteQueryStreamedAsync <TElement>(TableQuery <TElement> query, TableRequestOptions requestOptions = null, OperationContext operationContext = null)
        {
            // Philosophically, maybe this proxy-making belongs on the host
            // side, but that would require a second custom wrapper because we
            // still need the custom wrapper on the caller side to do the
            // different event types.
            IQueryStream <TElement> remoteStream = await nonannotatableCallProxy.ExecuteQueryStreamedAsync(
                query, requestOptions, operationContext);

            return(new QueryStreamPSharpProxy <TElement>(
                       PSharpRealProxy.MakeTransparentProxy(callerMachineId, hostMachineId, remoteStream,
                                                            null, () => new TableNonannotatableCallEvent())));
        }
Example #4
0
        public override async Task <IQueryStream <TElement> > ExecuteQueryStreamedAsync <TElement>(TableQuery <TElement> query, TableRequestOptions requestOptions = null, OperationContext operationContext = null)
        {
            //Trace.TraceInformation("{0} calling {1}.ExecuteQueryStreamedAsync({2})", callerMachineId, debugName, BetterComparer.ToString(query));
            // Philosophically, maybe this proxy-making belongs on the host
            // side, but that would require a second custom wrapper because we
            // still need the custom wrapper on the caller side to do the
            // different event types.
            IQueryStream <TElement> remoteStream = await plainEventProxy.ExecuteQueryStreamedAsync(
                query, requestOptions, operationContext);

            return(new QueryStreamPSharpProxy <TElement>(
                       PSharpRealProxy.MakeTransparentProxy(callerMachineId, hostMachineId, remoteStream,
                                                            string.Format("<{0} QueryStream>", debugName), () => new GenericDispatchableEvent())));
        }
Example #5
0
        internal ConfigurationServicePSharpProxy(MachineId callerMachineId, MachineId hostMachineId,
                                                 IConfigurationService <TConfig> original)
        {
            TConfig initialConfig;

            originalProxy = PSharpRealProxy.MakeTransparentProxy(callerMachineId, hostMachineId, original,
                                                                 null, () => new GenericDispatchableEvent());

            IConfigurationSubscriber <TConfig> subscriberReverseProxy =
                PSharpRealProxy.MakeTransparentProxy(hostMachineId, callerMachineId,
                                                     (IConfigurationSubscriber <TConfig>) new Subscriber(this), null,
                                                     () => new GenericDispatchableEvent());

            // XXX Implement IDisposable.  Would need to proxy the dispose as well.
            original.Subscribe(subscriberReverseProxy, out initialConfig);

            mirror = new InMemoryConfigurationService <TConfig>(initialConfig);
        }
Example #6
0
 public static TIface MakeTransparentProxy <TIface>(this Machine hostMachine, TIface target,
                                                    string targetDebugName, MachineId callerMachineId, EventFactory eventFactory)
 {
     return(PSharpRealProxy.MakeTransparentProxy(callerMachineId, hostMachine.Id, target, targetDebugName, eventFactory));
 }