/// <summary>Get a uniform hash code for this grain reference.</summary> public uint GetUniformHashCode() { // GrainId already includes the hashed type code for generic arguments. return(GrainId.GetUniformHashCode()); }
private bool GetUnordered() { if (RuntimeClient.Current == null) { return(false); } return(RuntimeClient.Current.GrainTypeResolver != null && RuntimeClient.Current.GrainTypeResolver.IsUnordered(GrainId.GetTypeCode())); }
/// <summary> /// Constructs a reference to the grain with the specified ID. /// </summary> /// <param name="grainId">The ID of the grain to refer to.</param> internal static GrainReference FromGrainId(GrainId grainId, string genericArguments = null, SiloAddress systemTargetSilo = null) { return(new GrainReference(grainId, genericArguments, systemTargetSilo, null)); }
internal static GrainReference NewObserverGrainReference(GrainId grainId, GuidId observerId) { return(new GrainReference(grainId, null, null, observerId)); }
private ActivationAddress(SiloAddress silo, GrainId grain, ActivationId activation) { Silo = silo; Grain = grain; Activation = activation; }
public static ActivationAddress NewActivationAddress(SiloAddress silo, GrainId grain) { var activation = ActivationId.NewId(); return(GetAddress(silo, grain, activation)); }
public static bool IsSystemGrain(GrainId grain) { return(systemGrainNames.ContainsKey(grain)); }
public HostedClient( IRuntimeClient runtimeClient, ClientObserverRegistrar clientObserverRegistrar, ILocalSiloDetails siloDetails, ILogger <HostedClient> logger, IGrainReferenceRuntime grainReferenceRuntime, IInternalGrainFactory grainFactory, InvokableObjectManager invokableObjectManager, ISiloMessageCenter messageCenter) { this.runtimeClient = runtimeClient; this.clientObserverRegistrar = clientObserverRegistrar; this.grainReferenceRuntime = grainReferenceRuntime; this.grainFactory = grainFactory; this.invokableObjects = invokableObjectManager; this.siloMessageCenter = messageCenter; this.logger = logger; this.siloMessageCenter.SetHostedClient(this); this.ClientAddress = ActivationAddress.NewActivationAddress(siloDetails.SiloAddress, GrainId.NewClientId()); }
public static bool TryGetSystemGrainName(GrainId id, out string name) { return(systemGrainNames.TryGetValue(id, out name)); }
public static bool IsSingletonSystemTarget(GrainId id) { return(singletonSystemTargetNames.ContainsKey(id)); }
/// <summary> Get the key value for this grain, as a string. </summary> public string ToKeyString() { return(String.IsNullOrEmpty(genericArguments) ? String.Format("{0}={1}", GRAIN_REFERENCE_STR, GrainId.ToParsableString()) : String.Format("{0}={1} {2}={3}", GRAIN_REFERENCE_STR, GrainId.ToParsableString(), GENERIC_ARGUMENTS_STR, genericArguments)); }
/// <summary> Calculates a hash code for a grain reference. </summary> public override int GetHashCode() { return(SystemTargetSilo == null?GrainId.GetHashCode() : GrainId.GetHashCode() ^ SystemTargetSilo.GetHashCode()); }
// For white-box testing only internal int UnregisterGrainForTesting(GrainId grain) { return(silo.catalog.UnregisterGrainForTesting(grain)); }