public override void Initialize(IFabricRuntimeSettings settings) { Container.Register( Component.For<IServiceHost>().Forward<MultitaskingServiceHost>().Instance(new MultitaskingServiceHost())); base.Initialize(settings); }
public virtual void Initialize(IFabricRuntimeSettings settings) { this.WriteDebugMessage(string.Format("Initializing {0}", GetType().Name)); if (settings.ServiceHost.Value == null) { throw new NoServiceHostConfiguredException("You must configure a service host."); } if (settings.HostedServices.Value == null || settings.HostedServices.Value.Count == 0) { throw new NoHostedServicesConfiguredException("You must configure hosted services."); } CurrentSettings = settings; try { _serviceHost = (IServiceHost)Container.Resolve(settings.ServiceHost.Value); } catch (ComponentNotFoundException e) { throw new ServiceHostNotResolvableException( string.Format("Unable to resolve service host of type {0} from container.", settings.ServiceHost.Value), e); } CurrentSettings = settings; this.WriteInfoMessage(string.Format("Initialized {0}.", GetType().Name)); }
public DefaultRuntimeStatistics( IList<Exception> hostedServiceExceptions, IList<Type> configuredHostedServices, Type configuredServiceHost, FabricRuntimeState runtimeState, IFabricRuntimeSettings settings) { HostedServiceExceptions = hostedServiceExceptions; ConfiguredHostedServices = configuredHostedServices; ConfiguredServiceHost = configuredServiceHost; RuntimeState = runtimeState; Settings = settings; }