internal void Init(ServiceExecutionHost host, ServiceEnvironmentConfiguration envConfig, ServiceConfiguration config, SchedulingInfo schedulingInfo, Guid instanceID, Guid parentInstanceID) { Host = host; this.Environment = new ServiceEnvironment(envConfig); this.InstanceID = instanceID; this.Configuration = config; this.SchedulingInfo = schedulingInfo; if (parentInstanceID != Guid.Empty) { this.ParentInstance = Environment.GetServiceInstance(parentInstanceID); } Current = this; // Monitor app domain-level events AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(this.DomainUnhandledException); AppDomain.CurrentDomain.DomainUnload += new EventHandler(this.DomainUnload); StateInfo.TimeInitialized = DateTime.Now; StateInfo.State = ServiceState.Ready; NotifyState(); }
// TODO: remove the reference to proxy from here, this should be loaded from a list of hosts in the database public ServiceEnvironment(ServiceEnvironmentConfiguration environmentConfig) { this.EnvironmentConfiguration = environmentConfig; RefreshHosts(); }
public static ServiceEnvironment Open(string usageName, ServiceEnvironmentConfiguration environmentConfig) { return(new ServiceEnvironment(usageName, environmentConfig)); }
private ServiceEnvironment(string usageName, ServiceEnvironmentConfiguration environmentConfig) { UsageName = usageName; EnvironmentConfiguration = environmentConfig; RefreshHosts(); }