Пример #1
0
        /// <summary>
        /// Returns a non-constructed version of this instance.
        /// </summary>
        public GenericGrainInterfaceType GetGenericGrainType()
        {
            var str     = this.Value.ToStringUtf8();
            var generic = TypeConverterExtensions.GetDeconstructed(str);

            return(new GenericGrainInterfaceType(GrainInterfaceType.Create(generic)));
        }
Пример #2
0
        /// <summary>
        /// Returns the generic interface id corresponding to the provided value.
        /// </summary>
        public static bool TryParse(GrainInterfaceType grainType, out GenericGrainInterfaceType result)
        {
            if (!grainType.IsDefault && TypeConverterExtensions.IsGenericType(grainType.Value))
            {
                result = new GenericGrainInterfaceType(grainType);
                return(true);
            }

            result = default;
            return(false);
        }
Пример #3
0
 public GrainReferenceShared(
     GrainType graintype,
     GrainInterfaceType grainInterfaceType,
     IGrainReferenceRuntime runtime,
     InvokeMethodOptions invokeMethodOptions)
 {
     this.GrainType           = graintype;
     this.InterfaceType       = grainInterfaceType;
     this.Runtime             = runtime;
     this.InvokeMethodOptions = invokeMethodOptions;
 }
Пример #4
0
 public GrainReferenceShared(
     GrainType grainType,
     GrainInterfaceType grainInterfaceType,
     ushort interfaceVersion,
     IGrainReferenceRuntime runtime,
     InvokeMethodOptions invokeMethodOptions,
     IServiceProvider serviceProvider)
 {
     this.GrainType           = grainType;
     this.InterfaceType       = grainInterfaceType;
     this.Runtime             = runtime;
     this.InvokeMethodOptions = invokeMethodOptions;
     this.ServiceProvider     = serviceProvider;
     this.InterfaceVersion    = interfaceVersion;
 }
Пример #5
0
 private GenericGrainInterfaceType(GrainInterfaceType value)
 {
     Value = value;
 }
Пример #6
0
 public IAddressable GetGrain(GrainId grainId, GrainInterfaceType interfaceId)
 {
     return(this.grainFactory.GetGrain(grainId, interfaceId));
 }
Пример #7
0
 public Task SetSelectorStrategy(GrainInterfaceType interfaceType, VersionSelectorStrategy strategy)
 {
     this.selectorManager.SetSelector(interfaceType, strategy);
     this.cachedVersionSelectorManager.ResetCache();
     return(Task.CompletedTask);
 }
Пример #8
0
 public Task SetCompatibilityStrategy(GrainInterfaceType interfaceId, CompatibilityStrategy strategy)
 {
     this.compatibilityDirectorManager.SetStrategy(interfaceId, strategy);
     this.cachedVersionSelectorManager.ResetCache();
     return(Task.CompletedTask);
 }
Пример #9
0
        /// <summary>
        /// Returns a constructed version of this instance.
        /// </summary>
        public GenericGrainInterfaceType Construct(TypeConverter formatter, params Type[] typeArguments)
        {
            var constructed = formatter.GetConstructed(this.Value.ToStringUtf8(), typeArguments);

            return(new GenericGrainInterfaceType(GrainInterfaceType.Create(constructed)));
        }