/// <summary>
        /// Constructor.
        /// </summary>
        public ConversationPointToPoint(ExecutionManager executionManager, Message message, ArbiterClientId senderID, ArbiterClientId receiverID, TimeSpan timeOut)
            : base(executionManager, senderID, timeOut)
        {
            _receiverID = receiverID;

            ExecutionEntityWithReply entity = new ExecutionEntityWithReply(this, receiverID, timeOut,
                MessageContainer.DuplicateMessage(message, false));

            ExecutionManager.AddExecutionEntity(entity);
        }
        /// 
        /// </summary>
        public ConversationMultiPoint(ExecutionManager executionManager, Message message, ArbiterClientId senderID, IEnumerable<ArbiterClientId> receivers, TimeSpan timeOut)
            : base(executionManager, senderID, timeOut)
        {
            _receivers.AddRange(receivers);

            foreach (ArbiterClientId receiverID in receivers)
            {
                ExecutionEntity entity = new ExecutionEntity(this, receiverID, TimeSpan.Zero, MessageContainer.DuplicateMessage(message, false));
                _executingEntities.Add(entity);
                ExecutionManager.AddExecutionEntity(entity);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 
 /// </summary>
 public Conversation(ExecutionManager executionManager, ArbiterClientId ownerID, TimeSpan timeOut)
     : base(timeOut)
 {
     _ownerID = ownerID;
     _executionManager = executionManager;
 }
Ejemplo n.º 4
0
 /// <summary>
 ///
 /// </summary>
 public Arbiter(string name)
 {
     _name = name;
     _timeOutMonitor.EntityTimedOutEvent += new HandlerDelegate <TimeOutable>(_timeOutMonitor_EntityTimedOutEvent);
     _executionManager = new ExecutionManager(this);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public Arbiter(string name)
 {
     _name = name;
     _timeOutMonitor.EntityTimedOutEvent += new HandlerDelegate<TimeOutable>(_timeOutMonitor_EntityTimedOutEvent);
     _executionManager = new ExecutionManager(this);
 }
Ejemplo n.º 6
0
        public void Dispose()
        {
            _isDisposed = true;

            lock (_timeOutMonitor)
            {
                _timeOutMonitor.Dispose();
                _timeOutMonitor = null;
            }

            lock (_executionManager)
            {
                _executionManager.Dispose();
                _executionManager = null;
            }

            lock (_clientsAndFilters)
            {// Remove all clients to allow them to UnInitialize, and if they have any unmanaged resources - release them.
                List<IArbiterClient> clients = new List<IArbiterClient>(_clientsAndFilters.Keys);
                foreach(IArbiterClient client in clients)
                {
                    this.RemoveClient(client);
                }
            }
        }