Beispiel #1
0
        public ComponentRegistration <TActor> Build()
        {
            ActorHelpers.ValidateServiceType(ServiceType);

            return(_registration
                   .AddAttributeDescriptor(FacilityConstants.ActorKey, bool.TrueString)
                   .AddAttributeDescriptor(FacilityConstants.ActorServiceTypeKey, ServiceType.AssemblyQualifiedName)
                   .ExtendedProperties(
                       Property.ForKey <Func <ActorBase, IActorStateProvider, IActorStateManager> >().Eq(StateManagerFactory),
                       Property.ForKey <ActorServiceSettings>().Eq(ServiceSettings)));
        }
Beispiel #2
0
        public ComponentRegistration <TService> Build()
        {
            if (string.IsNullOrEmpty(ServiceTypeName))
            {
                throw new ComponentRegistrationException("Stateless ServiceTypeName cannot be null or empty");
            }

            return(_registration
                   .AddAttributeDescriptor(FacilityConstants.StatelessServiceKey, bool.TrueString)
                   .AddAttributeDescriptor(FacilityConstants.ServiceTypeNameKey, ServiceTypeName));
        }
Beispiel #3
0
        public ComponentRegistration <TService> Build()
        {
            if (string.IsNullOrEmpty(ServiceTypeName))
            {
                throw new ComponentRegistrationException("Stateful ServiceTypeName cannot be null or empty");
            }

            if (StateManagerConfiguration != null)
            {
                _registration.ExtendedProperties(
                    Property
                    .ForKey <ReliableStateManagerConfiguration>()
                    .Eq(StateManagerConfiguration));
            }

            return(_registration
                   .AddAttributeDescriptor(FacilityConstants.StatefulServiceKey, bool.TrueString)
                   .AddAttributeDescriptor(FacilityConstants.ServiceTypeNameKey, ServiceTypeName));
        }
 /// <summary>
 /// Registers the generic argument type <typeparamref name="TActor"/> as an actor type.
 /// </summary>
 /// <typeparam name="TActor">Type must derive from ActorBase</typeparam>
 /// <param name="registration">ComponentRegistration instance</param>
 /// <returns>ComponentRegistration instance for continued registration</returns>
 public static ComponentRegistration <TActor> AsActor <TActor>(this ComponentRegistration <TActor> registration)
     where TActor : ActorBase
 {
     return(registration.AddAttributeDescriptor(FacilityConstants.ActorKey, bool.TrueString));
 }
 public static ComponentRegistration <TService> Start <TService>(this ComponentRegistration <TService> registration)
     where TService : class
 {
     return(registration.AddAttributeDescriptor("startable", true.ToString()));
 }
        /// <summary>
        ///   Builds the <see cref = "AttributeKeyDescriptor{S}" /> with value.
        /// </summary>
        /// <param name = "value">The attribute value.</param>
        /// <returns>The <see cref = "ComponentRegistration{S}" /></returns>
        public ComponentRegistration <S> Eq(Object value)
        {
            var attribValue = (value != null) ? value.ToString() : "";

            return(component.AddAttributeDescriptor(name, attribValue));
        }
Beispiel #7
0
 /// <summary>
 /// Register the specified service type as a stateful service. A valid service type must be provided.
 /// </summary>
 /// <typeparam name="TService">Type must derive from <see cref="StatefulServiceBase"/></typeparam>
 /// <param name="registration">ComponentRegistration instance</param>
 /// <param name="serviceTypeName">ServiceTypeName for the given service class</param>
 /// <returns>ComponentRegistration for continued Fluent API registrations.</returns>
 public static ComponentRegistration <TService> AsStatefulService <TService>(this ComponentRegistration <TService> registration, string serviceTypeName)
     where TService : StatefulServiceBase
 {
     return(registration.AddAttributeDescriptor(FacilityConstants.StatefulServiceKey, bool.TrueString)
            .AddAttributeDescriptor(FacilityConstants.ServiceTypeNameKey, serviceTypeName));
 }