internal CallPayload(PSharpRealProxy realProxy, ReplyTarget <TResult> replyTarget, MethodInfo method, object[] args) { this.realProxy = realProxy; this.replyTarget = replyTarget; this.method = method; this.args = args; }
// Important: TIface must be an interface (or subclass of MarshalByRefObject). // This is easy to mess up if you allow it to be inferred. public static TIface MakeTransparentProxy <TIface>(MachineId callerMachineId, MachineId hostMachineId, TIface target, string targetDebugName, EventFactory eventFactory) { // XXX: Verify up front that TIface is an interface with all methods acceptable? var realProxy = new PSharpRealProxy(typeof(TIface), callerMachineId, hostMachineId, target, targetDebugName, eventFactory); return((TIface)realProxy.GetTransparentProxy()); }
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()); }
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()); }
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()))); }
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()))); }
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); }
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)); }
internal Capturer(PSharpRealProxy outer, IMethodCallMessage callMsg) { this.outer = outer; this.callMsg = callMsg; }