private static NodeManager GetInstance()
		{
			//use local var because we set _instance to null on shutdown and could
			//cause concurrency problem
			NodeManager instance = _instance;
			if (instance == null)
			{
				lock (_instanceLock)
				{
					if (_instance == null)
					{
						_instance = new NodeManager();
					}
					instance = _instance;
				}
			}
			return instance;
		}
		internal void Shutdown()
		{
			if (Counters != null)
			{
				Counters.ResetCounters();
				Counters.Shutdown();
			}
			if (InMessageDispatcher != null)
			{
				InMessageDispatcher.Dispose();
			}
			if (_queuedMessageCounterTimer != null)
			{
				_queuedMessageCounterTimer.Change(Timeout.Infinite, Timeout.Infinite);
				_queuedMessageCounterTimer.Dispose();
			}
			if (_aggregateCounterTickTimer != null)
			{
				_aggregateCounterTickTimer.Change(Timeout.Infinite, Timeout.Infinite);
				_aggregateCounterTickTimer.Dispose();
			}

			if (NodeGroups != null)
			{
				for (int i = 0; i < NodeGroups.Count; i++)
				{
					NodeGroups[i].Shutdown();
				}
			}
				
			lock (_instanceLock)
			{
				_initialized = false;
				//Release instance to free memory and to get initialized fresh.
				_instance = null;
			}
		}