#pragma warning disable 612,618 internal static PlacementStrategy GetPlacementStrategy(Type grainClass) { PlacementStrategy placement; if (GetPlacementStrategy <StatelessWorkerAttribute>( grainClass, (StatelessWorkerAttribute attr) => { return(new StatelessWorkerPlacement(attr.MaxLocalWorkers)); }, out placement)) { return(placement); } if (GetPlacementStrategy <PlacementAttribute>( grainClass, a => a.PlacementStrategy, out placement)) { return(placement); } return(PlacementStrategy.GetDefault()); }
internal GrainClassData(int grainTypeCode, string grainClass, GrainInterfaceData interfaceData, PlacementStrategy placement) { GrainTypeCode = grainTypeCode; GrainClass = grainClass; this.interfaceData = interfaceData; genericClassNames = new Dictionary <string, string>(); // TODO: initialize only for generic classes placementStrategy = placement ?? PlacementStrategy.GetDefault(); }
internal GrainClassData(int grainTypeCode, string grainClass, bool isGeneric, GrainInterfaceData interfaceData, PlacementStrategy placement, MultiClusterRegistrationStrategy registrationStrategy) { GrainTypeCode = grainTypeCode; GrainClass = grainClass; this.isGeneric = isGeneric; this.interfaceData = interfaceData; genericClassNames = new Dictionary <string, string>(); // TODO: initialize only for generic classes placementStrategy = placement ?? PlacementStrategy.GetDefault(); this.registrationStrategy = registrationStrategy ?? MultiClusterRegistrationStrategy.GetDefault(); }
#pragma warning disable 612,618 internal static PlacementStrategy GetPlacementStrategy(Type grainClass) { PlacementStrategy placement; if (GetPlacementStrategy <StatelessWorkerAttribute>( grainClass, _ => GrainStrategy.StatelessWorkerPlacement, out placement)) { return(placement); } if (GetPlacementStrategy <PlacementAttribute>( grainClass, a => a.PlacementStrategy, out placement)) { return(placement); } return(PlacementStrategy.GetDefault()); }