public NativeRuntime.IFabricStatelessServiceInstance CreateInstance( IntPtr nativeServiceType, IntPtr nativeServiceName, uint initializationDataLength, IntPtr nativeInitializationData, Guid partitionId, long instanceId) { Func <IStatelessServiceFactory, ServiceInitializationParameters, IStatelessServiceInstance> creationFunc = (factory, initParams) => { return(factory.CreateInstance(initParams.ServiceTypeName, initParams.ServiceName, initParams.InitializationData, partitionId, instanceId)); }; ServiceInitializationParameters initializationParameters = new StatelessServiceInitializationParameters(this.codePackageActivationContext) { InstanceId = instanceId }; IStatelessServiceInstance statelessService = this.CreateHelper <IStatelessServiceFactory, IStatelessServiceInstance>( nativeServiceType, nativeServiceName, initializationDataLength, nativeInitializationData, partitionId, creationFunc, (inst, initParams) => inst.Initialize(initParams as StatelessServiceInitializationParameters), initializationParameters); return(new StatelessServiceBroker(statelessService, initializationParameters, instanceId)); }
public ICommunicationListener CreateCommunicationListener(IStatelessServiceInstance instance) { if (instance == null) { throw new ArgumentNullException(nameof(instance)); } return(new AspNetCoreCommunicationListener(instance, WebHost, AddUrlPrefix)); }
public ICommunicationListener CreateCommunicationListener(IStatelessServiceInstance instance) { if (instance == null) { throw new ArgumentNullException(nameof(instance)); } return new AspNetCoreCommunicationListener(instance, WebHost, AddUrlPrefix); }
internal StatelessServiceBroker(IStatelessServiceInstance statelessServiceInstance, ServiceInitializationParameters initializationParameters, long instanceId) { Requires.Argument("statelessServiceInstance", statelessServiceInstance).NotNull(); Requires.Argument("initializationParameters", initializationParameters).NotNull(); this.statelessService = statelessServiceInstance; this.initializationParameters = initializationParameters; this.instanceId = instanceId; }
public AspNetCoreCommunicationListener(IStatelessServiceInstance instance, IWebHost webHost, bool addUrlPrefix) { if (instance == null) { throw new ArgumentNullException(nameof(instance)); } if (webHost == null) { throw new ArgumentNullException(nameof(webHost)); } _instanceOrReplica = instance; _webHost = webHost; _addUrlPrefix = addUrlPrefix; }