Exemple #1
0
 public bool InitializeReaders(int numberOfReaders)
 {
     lock (_thisLock)
     {
         try
         {
             if (MessageBusReaderBank == null)
             {
                 throw new InvalidOperationException(ExceptionMessage_MessageBusReaderBankCannotBeNull);
             }
             else
             {
                 for (int readerIndex = 0; readerIndex < numberOfReaders; readerIndex++)
                 {
                     MessageBusReaderBank.AddAnotherReader(MessageBusReaderCallback);
                 }
                 return(true);
             }
         }
         catch (InvalidOperationException ex)
         {
             throw new InvalidOperationException(ex.Message, ex);
         }
         catch (Exception ex)
         {
             throw new ApplicationException(ex.Message, ex);
         }
     }
 }
Exemple #2
0
        public void Dispose()
        {
            if (_isDisposed == false)
            {
                if (RoutingTable != null)
                {
                    RoutingTable.Dispose();
                }
                if (MessageBusReaderBank != null)
                {
                    MessageBusReaderBank.Dispose();
                }

                _isDisposed = true;
            }
        }