public RunnerThread(IComponentFactoryConfiguration cfg, string service, ActionContext context, int iterations, int iterationDelay) { Cfg = cfg; ServiceName = service; Context = context; IterationsCount = iterations; IterationDelay = iterationDelay; ComponentFactory = new NReco.Application.Ioc.ComponentFactory(Cfg); Thrd = new Thread(new ThreadStart(Execute)); RunnerThreadsMap.Add(Thrd, this); }
protected virtual void Dispose(bool disposing) { if (disposing) { var flag = false; try { Monitor.Enter(this, ref flag); if (this.site != null && this.site.Container != null) { this.site.Container.Remove(this); } // lets remove references if (componentInstanceByName != null) { componentInstanceByName.Clear(); } if (componentInstanceByType != null) { componentInstanceByType.Clear(); } if (components != null) { // dispose components foreach (var c in components) { if (c is IDisposable) { ((IDisposable)c).Dispose(); } } components.Clear(); } componentInstanceByName = null; components = null; _Config = null; if (Disposed != null) { Disposed(this, EventArgs.Empty); } } finally { if (flag) { Monitor.Exit(this); } } } }
public ComponentFactory(IComponentFactoryConfiguration config) : base(config) { }
/// <summary> /// Initializes a new instance of the ComponentFactory class with specified componet configuration and counters option. /// </summary> /// <param name="config">IComponentFactoryConfiguration component</param> /// <param name="countersEnabled">enables stats counters (component creation / retrieving)</param> public ComponentFactory(IComponentFactoryConfiguration config, bool countersEnabled) { CountersEnabled = countersEnabled; Configuration = config; Init(); }
/// <summary> /// Initializes a new instance of the ComponentFactory class with specified componet configuration. /// </summary> /// <param name="config">IComponentFactoryConfiguration component</param> public ComponentFactory(IComponentFactoryConfiguration config) : this(config, false) { }