2 using System.Collections.Generic;
14 #region IDisposable Member
22 GC.SuppressFinalize(
this);
30 protected virtual void Dispose(
bool disposing)
46 private Queue<Exception> _Exceptions =
new Queue<Exception>();
53 public IList<Exception> Exceptions
55 get {
return _Exceptions.ToList(); }
64 _Exceptions.Enqueue(Exception);
65 if (_Exceptions.Count > 30)
67 _Exceptions.Dequeue();
78 public string HostName {
get; set; }
86 public Thread Thread {
get; set; }
94 public DateTime LastHeartBeat {
get;
private set; }
101 LastHeartBeat = DateTime.Now;
104 private int _HeartBeatTimeOutMs=1000;
112 public int HeartBeatTimeOutMs
114 get {
return _HeartBeatTimeOutMs; }
115 set { _HeartBeatTimeOutMs = value; }
129 public string ThreadName
131 get {
return Thread.Name; }
145 return Thread.IsAlive;
155 this.Thread = Thread;
166 : this(Thread.CurrentThread)
void HeartBeat()
HeartBeat has to be called regularely to update the LastHeartBeat property.
ThreadInfo(Thread Thread)
Initializes a new instance of the ThreadInfo class.
void RecordException(Exception Exception)
Adds a captured exception to the Expeptions list.
This object provides information on a thread.
ThreadInfo()
Initializes a new instance of the ThreadInfo class for the thread creating the instance.
virtual void Dispose(bool disposing)
Releases unmanaged and - optionally - managed resources.
void Dispose()
Cleans up the resources used by instances of this class.