Esempio n. 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)));
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public GrainReferenceShared(
     GrainType graintype,
     GrainInterfaceType grainInterfaceType,
     IGrainReferenceRuntime runtime,
     InvokeMethodOptions invokeMethodOptions)
 {
     this.GrainType           = graintype;
     this.InterfaceType       = grainInterfaceType;
     this.Runtime             = runtime;
     this.InvokeMethodOptions = invokeMethodOptions;
 }
Esempio n. 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;
 }
Esempio n. 5
0
 private GenericGrainInterfaceType(GrainInterfaceType value)
 {
     Value = value;
 }
Esempio n. 6
0
 public IAddressable GetGrain(GrainId grainId, GrainInterfaceType interfaceId)
 {
     return(this.grainFactory.GetGrain(grainId, interfaceId));
 }
Esempio n. 7
0
 public Task SetSelectorStrategy(GrainInterfaceType interfaceType, VersionSelectorStrategy strategy)
 {
     this.selectorManager.SetSelector(interfaceType, strategy);
     this.cachedVersionSelectorManager.ResetCache();
     return(Task.CompletedTask);
 }
Esempio n. 8
0
 public Task SetCompatibilityStrategy(GrainInterfaceType interfaceId, CompatibilityStrategy strategy)
 {
     this.compatibilityDirectorManager.SetStrategy(interfaceId, strategy);
     this.cachedVersionSelectorManager.ResetCache();
     return(Task.CompletedTask);
 }
Esempio n. 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)));
        }