protected bool HostUnInitialize()
        {
            lock (this)
            {
                if (_isConnectedToPlatform)
                {
                    _isConnectedToPlatform = false;
                }

                while (_existingSessions.Count > 0)
                {
                    DestroySession(_existingSessions[0]);
                }
                _expert.UnInitialize();
                _expert = null;
            }
            return true;
        }
        protected bool HostInitialize()
        {
            string expertName = this.Name + ".expert";// this.Name.Replace(".host", ".expert");

            // Clean expertname since we might be sending it trough command line.
            expertName = expertName.Replace(" ", "_");
            expertName = expertName.Replace("\"", "");

            lock (this)
            {
                // Create the expert.
                ConstructorInfo constructor = _expertType.GetConstructor(new Type[] { typeof(AnalyzerHost), typeof(string) });

                //SystemMonitor.CheckThrow(constructor != null, "Failed to find corresponding constructor for expert type [" + _expertType.ToString() + "].");
                _expert = (Analyzer)constructor.Invoke(new object[] { this, expertName });

                if (_expert.Initialize() == false)
                {
                    //SystemMonitor.Error("Analyzer host failed to connect to platform.");
                    return false;
                }
               _isConnectedToPlatform = true;
                return true;

            }
        }