/// <summary> /// Remove entity from monitoring. /// </summary> /// <param name="entity"></param> public bool RemoveEntity(TimeOutable entity) { lock (_entities) { return _entities.Remove(entity); } }
/// <summary> /// /// </summary> /// <param name="parameter0"></param> void _timeOutMonitor_EntityTimedOutEvent(TimeOutable parameter0) { SystemMonitor.Error("_timeOutMonitor_EntityTimedOutEvent"); ExecutionEntity entity = (ExecutionEntity)parameter0; entity.Conversation.EntityTimedOut(entity); }
/// <summary> /// Remove entity from monitoring. /// </summary> /// <param name="entity"></param> public bool RemoveEntity(TimeOutable entity) { lock (_entities) { return(_entities.Remove(entity)); } }
/// <summary> /// Add entity to be monitored. /// </summary> /// <param name="envelope"></param> public bool AddEntity(TimeOutable entity) { lock (_entities) { _entities.Add(entity); } return true; }
/// <summary> /// Add entity to be monitored. /// </summary> /// <param name="envelope"></param> public bool AddEntity(TimeOutable entity) { lock (_entities) { _entities.Add(entity); } return(true); }
/// <summary> /// /// </summary> /// <param name="parameter0"></param> protected void _timeOutMonitor_EntityTimedOutEvent(TimeOutable parameter0) { Conversation conversation = (Conversation)parameter0; IArbiterClient client = GetClientByID(conversation.OwnerID, false); if (client != null) { client.ReceiveConversationTimedOut(conversation); } }
/// <summary> /// Perform checks and updates. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void _timeOutTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { lock (_entities) { // Backwards cycling as the collections get modified while cycling. for (int i = _entities.Count - 1; i >= 0; i--) { TimeOutable entity = _entities[i]; if (entity.TimedOut || entity.IsAlive == false) {// If timed out or dead, remove. _entities.Remove(entity); if (entity.TimedOut && EntityTimedOutEvent != null) {// Notify whoever might be interested. EntityTimedOutEvent(entity); } } } } }