Exemplo 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)));
        }
Exemplo 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);
        }
Exemplo 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;
 }
Exemplo 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;
 }
Exemplo n.º 5
0
 private GenericGrainInterfaceType(GrainInterfaceType value)
 {
     Value = value;
 }
Exemplo n.º 6
0
 public IAddressable GetGrain(GrainId grainId, GrainInterfaceType interfaceId)
 {
     return(this.grainFactory.GetGrain(grainId, interfaceId));
 }
Exemplo n.º 7
0
 public Task SetSelectorStrategy(GrainInterfaceType interfaceType, VersionSelectorStrategy strategy)
 {
     this.selectorManager.SetSelector(interfaceType, strategy);
     this.cachedVersionSelectorManager.ResetCache();
     return(Task.CompletedTask);
 }
Exemplo n.º 8
0
 public Task SetCompatibilityStrategy(GrainInterfaceType interfaceId, CompatibilityStrategy strategy)
 {
     this.compatibilityDirectorManager.SetStrategy(interfaceId, strategy);
     this.cachedVersionSelectorManager.ResetCache();
     return(Task.CompletedTask);
 }
Exemplo 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)));
        }