internal void Activate() { Activated = true; Id = GenericContext <ActorId> .Current.Value; Debug.Assert(!string.IsNullOrEmpty(Id.ApplicationName)); ApplicationName = Id.ApplicationName; ApplicationManifestAttribute appManifest = this.GetType().GetCustomAttributes <ApplicationManifestAttribute>().SingleOrDefault(manifest => manifest.ApplicationName.Equals(ApplicationName)); Debug.Assert(appManifest != null); Debug.Assert(appManifest.ApplicationName.Equals(ApplicationName)); ServiceUri = new Uri("fabric:/" + appManifest.ApplicationName + "/" + appManifest.ServiceName); ServiceContext context = GenericContext <ServiceContext> .Current.Value; ActorService = (context == null) ? new ActorService(null, ActorTypeInformation.Get(GetType())) : new ActorService(new StatefulServiceContext(context.ServiceName), ActorTypeInformation.Get(GetType())); }
public static bool TryGet(Type actorType, out ActorTypeInformation actorTypeInformation) { actorTypeInformation = Get(actorType); return(actorTypeInformation != null); }
public ActorService(StatefulServiceContext context, ActorTypeInformation actorTypeInfo) { Context = context; ActorTypeInformation = actorTypeInfo; ServiceReplicaListeners = CreateServiceReplicaListeners(); }