示例#1
0
 public FaultInjectionTransactionalResource(IControlledTransactionFaultInjector faultInjector, FaultInjectionControl faultInjectionControl, TransactionalResource <TState> tResource, IGrainActivationContext activationContext, ILogger logger, IGrainRuntime grainRuntime)
 {
     this.grainRuntime          = grainRuntime;
     this.tResource             = tResource;
     this.faultInjectionControl = faultInjectionControl;
     this.logger        = logger;
     this.faultInjector = faultInjector;
     this.context       = activationContext;
 }
示例#2
0
 public FaultInjectionTransactionManager(IControlledTransactionFaultInjector faultInjector, FaultInjectionControl faultInjectionControl, TransactionManager <TState> tm, IGrainActivationContext activationContext, ILogger logger, IGrainRuntime grainRuntime)
 {
     this.grainRuntime          = grainRuntime;
     this.tm                    = tm;
     this.faultInjectionControl = faultInjectionControl;
     this.logger                = logger;
     this.context               = activationContext;
     this.faultInjector         = faultInjector;
 }
示例#3
0
 public FaultInjectionTransactionalState(TransactionalState <TState> txState, IGrainActivationContext activationContext, IGrainRuntime grainRuntime, ILogger <FaultInjectionTransactionalState <TState> > logger)
 {
     this.grainRuntime          = grainRuntime;
     this.txState               = txState;
     this.logger                = logger;
     this.FaultInjectionControl = new FaultInjectionControl();
     //fault injector has to be injected to DI as a scoped service, so each grain activation share one injector. but different grain activation use different ones.
     this.faultInjector = activationContext.ActivationServices.GetService <IControlledTransactionFaultInjector>();
     if (this.faultInjector == null)
     {
         throw new ArgumentOutOfRangeException($"Incorrect {nameof(faultInjector)} type configured. Only {nameof(IControlledTransactionFaultInjector)} is allowed.");
     }
 }