コード例 #1
0
ファイル: ConsoleFabric.cs プロジェクト: smhinsey/Euclid
		public override void Initialize(IFabricRuntimeSettings settings)
		{
			Container.Register(
				Component.For<IServiceHost>().Forward<MultitaskingServiceHost>().Instance(new MultitaskingServiceHost()));

			base.Initialize(settings);
		}
コード例 #2
0
ファイル: BasicFabric.cs プロジェクト: smhinsey/Euclid
		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));
		}
コード例 #3
0
		public DefaultRuntimeStatistics(
			IList<Exception> hostedServiceExceptions,
			IList<Type> configuredHostedServices,
			Type configuredServiceHost,
			FabricRuntimeState runtimeState,
			IFabricRuntimeSettings settings)
		{
			HostedServiceExceptions = hostedServiceExceptions;
			ConfiguredHostedServices = configuredHostedServices;
			ConfiguredServiceHost = configuredServiceHost;
			RuntimeState = runtimeState;
			Settings = settings;
		}