public NativeRuntime.IFabricStatefulServiceReplica CreateReplica( IntPtr nativeServiceType, IntPtr nativeServiceName, uint initializationDataLength, IntPtr nativeInitializationData, FABRIC_PARTITION_ID partitionId, FABRIC_REPLICA_ID replicaId) { Func <IStatefulServiceFactory, ServiceInitializationParameters, IStatefulServiceReplica> creationFunc = (factory, initParams) => { return(factory.CreateReplica(initParams.ServiceTypeName, initParams.ServiceName, initParams.InitializationData, partitionId, replicaId)); }; ServiceInitializationParameters initializationParameters = new StatefulServiceInitializationParameters(this.codePackageActivationContext) { ReplicaId = replicaId }; IStatefulServiceReplica statefulService = this.CreateHelper <IStatefulServiceFactory, IStatefulServiceReplica>( nativeServiceType, nativeServiceName, initializationDataLength, nativeInitializationData, partitionId, creationFunc, (inst, initParams) => inst.Initialize(initParams as StatefulServiceInitializationParameters), initializationParameters); return(new StatefulServiceReplicaBroker(statefulService, initializationParameters, replicaId)); }
public ICommunicationListener CreateCommunicationListener(IStatefulServiceReplica replica) { if (replica == null) { throw new ArgumentNullException(nameof(replica)); } return(new AspNetCoreCommunicationListener(replica, WebHost, AddUrlPrefix)); }
public ICommunicationListener CreateCommunicationListener(IStatefulServiceReplica replica) { if (replica == null) { throw new ArgumentNullException(nameof(replica)); } return new AspNetCoreCommunicationListener(replica, WebHost, AddUrlPrefix); }
public AspNetCoreCommunicationListener(IStatefulServiceReplica replica, IWebHost webHost, bool addUrlPrefix) { if (replica == null) { throw new ArgumentNullException(nameof(replica)); } if (webHost == null) { throw new ArgumentNullException(nameof(webHost)); } _instanceOrReplica = replica; _webHost = webHost; _addUrlPrefix = addUrlPrefix; }
public AspNetCoreCommunicationListener(IStatefulServiceReplica replica, IWebHost webHost, bool addUrlPrefix) { if (replica == null) { throw new ArgumentNullException(nameof(replica)); } if (webHost == null) { throw new ArgumentNullException(nameof(webHost)); } _instanceOrReplica = replica; _webHost = webHost; _addUrlPrefix = addUrlPrefix; }
public StatefulServiceReplicaBroker(IStatefulServiceReplica statefulServiceReplica, ServiceInitializationParameters initializationParameters, long replicaId) { Requires.Argument("statefulServiceReplica", statefulServiceReplica).NotNull(); Requires.Argument("initializationParameters", initializationParameters).NotNull(); this.statefulServiceReplica = statefulServiceReplica; this.initializationParameters = initializationParameters; this.replicaId = replicaId; // KVS is currently the only service that internally supports returning additional // DeployedStatefulServiceReplicaDetail information. If we ever support custom // information from user services, then GetQueryResult() can be exposed via IStatefulServiceReplica. // var casted = this.statefulServiceReplica as KeyValueStoreReplica; if (casted != null) { this.internalReplica = casted.InternalStore; } }