Пример #1
0
 protected InterceptedFunctionBase(
     InterceptedMethod method,
     IComputedRegistry computedRegistry)
     : base(computedRegistry)
 {
     Method = method;
 }
Пример #2
0
 public ComputeServiceFunction(
     InterceptedMethod method,
     Generator <LTag> versionGenerator,
     ILogger <ComputeServiceFunction <T> >?log = null)
     : base(method)
 {
     Log = log ??= NullLogger <ComputeServiceFunction <T> > .Instance;
     VersionGenerator = versionGenerator;
 }
Пример #3
0
 public ComputedServiceFunction(
     InterceptedMethod method,
     Generator <LTag> lTagGenerator,
     IComputedRegistry computedRegistry,
     ILogger <ComputedServiceFunction <T> >?log = null)
     : base(method, computedRegistry)
 {
     _log          = log ??= NullLogger <ComputedServiceFunction <T> > .Instance;
     LTagGenerator = lTagGenerator;
 }
Пример #4
0
 public ReplicaClientFunction(
     InterceptedMethod method,
     Generator <LTag> versionGenerator,
     IComputedRegistry computedRegistry,
     ILogger <ReplicaClientFunction <T> >?log = null)
     : base(method, computedRegistry)
 {
     Log = log ??= NullLogger <ReplicaClientFunction <T> > .Instance;
     IsLogDebugEnabled  = Log.IsEnabled(LogLevel.Debug);
     VersionGenerator   = versionGenerator;
     InvalidatedHandler = null;
 }
Пример #5
0
 public ReplicaServiceFunction(
     InterceptedMethod method,
     Generator <LTag> lTagGenerator,
     IComputedRegistry computedRegistry,
     ILogger <ReplicaServiceFunction <T> >?log = null)
     : base(method, computedRegistry)
 {
     _log = log ??= NullLogger <ReplicaServiceFunction <T> > .Instance;
     _isLogDebugEnabled = _log.IsEnabled(LogLevel.Debug);
     LTagGenerator      = lTagGenerator;
     InvalidatedHandler = null;
 }
 public ReplicaClientFunction(
     InterceptedMethod method,
     IReplicator replicator,
     Generator <LTag> versionGenerator,
     ILogger <ReplicaClientFunction <T> >?log = null)
     : base(method, ((IReplicatorImpl)replicator).ServiceProvider)
 {
     Log = log ??= NullLogger <ReplicaClientFunction <T> > .Instance;
     IsLogDebugEnabled = Log.IsEnabled(LogLevel.Debug);
     VersionGenerator  = versionGenerator;
     Replicator        = replicator;
 }
 public ComputeServiceFunction(
     InterceptedMethod method,
     Generator <LTag> versionGenerator,
     IServiceProvider serviceProvider,
     ILogger <ComputeServiceFunction <T> >?log = null)
     : base(method, versionGenerator, serviceProvider, log)
 {
     if (method.Options.IsAsyncComputed)
     {
         throw Errors.InternalError(
                   $"This type can't be used with {nameof(ComputedOptions)}.{nameof(ComputedOptions.IsAsyncComputed)} == true option.");
     }
 }
Пример #8
0
 public override IEnumerable <CustomParameterInfo> GetRequiredParameterLayout()
 {
     if (!InterceptedMethod.IsStatic)
     {
         yield return(InterceptedMethod.DeclaringType);
     }
     foreach (var el in InterceptedMethod.GetParameters())
     {
         if (el.ParameterType.IsByRef)
         {
             yield return(el);
         }
         else
         {
             yield return(el.ParameterType.MakeByRefType());
         }
     }
 }
Пример #9
0
 public virtual IEnumerable <CustomParameterInfo> GetRequiredParameterLayout()
 {
     if (HasResultAsFirstParameter)
     {
         yield return((InterceptedMethod as MethodInfo).ReturnType);
     }
     if (!InterceptedMethod.IsStatic)
     {
         yield return(InterceptedMethod.DeclaringType);
     }
     foreach (var param in InterceptedMethod.GetParameters())
     {
         yield return(param);
     }
     if (RequiresLocalToCacheOutResult)
     {
         yield return(new CustomParameterInfo((InterceptedMethod as MethodInfo).ReturnType, true));
     }
 }
Пример #10
0
 public void OnException(InterceptedMethod method, Exception ee)
 {
     string methodPath = string.Format("{0}.{1}", method.Target.GetType().ToString(), method.MethodName);
     this.exceptionFilter.Log(ee, methodPath, method.GenericTypes, method.ArgumentNames, method.ArgumentValues);
 }
Пример #11
0
 public void BeginAround(InterceptedMethod method)
 {
 }
        protected override InterceptedFunctionBase <T> CreateFunction <T>(InterceptedMethod method)
        {
            var log = LoggerFactory.CreateLogger <ComputedServiceFunction <T> >();

            return(new ComputedServiceFunction <T>(method, LTagGenerator, Registry, log));
        }
 protected InterceptedFunctionBase(InterceptedMethod method)
     : base()
 {
     Method = method;
 }
Пример #14
0
        protected override InterceptedFunctionBase <T> CreateFunction <T>(InterceptedMethod method)
        {
            var log = LoggerFactory.CreateLogger <ReplicaClientFunction <T> >();

            return(new ReplicaClientFunction <T>(method, VersionGenerator, Registry, log));
        }
Пример #15
0
 public void PostProcess(InterceptedMethod method, object returnVal)
 {
 }
Пример #16
0
 public bool PreProcess(InterceptedMethod method)
 {
     return true;
 }
 protected InterceptedFunctionBase(InterceptedMethod method, IServiceProvider serviceProvider)
     : base(serviceProvider)
 {
     Method  = method;
     Options = method.Options;
 }