public void EnsureRegistered(ModuleDefinition module)
		{
			if(!_modules.Any(m => m.Name == module.Name && m.Version == module.Version))
			{
				lock (_lock)
				{
					if (!_modules.Any(m => m.Name == module.Name && m.Version == module.Version))
					{
						_modules.Add(module);
					}
				}
			}
		}
		public void SubscribeToDonkyNotifications(ModuleDefinition module, params DonkyNotificationSubscription[] subscriptions)
		{
			_moduleManager.EnsureRegistered(module);

			lock (_subscriptionLock)
			{
				_donkySubscriptions.AddRange(subscriptions);
			}

            _logger.LogDebug("Added subscription for Donky notification types {0} for module {1}",
                String.Join(",", subscriptions.Select(s => s.Type)),
                module.Name);
		}
		public void SubscribeToOutboundNotifications(ModuleDefinition module, params OutboundNotificationSubscription[] subscriptions)
		{
			if (subscriptions == null || subscriptions.Length == 0)
			{
				throw new ArgumentException("At least one subscription should be specified", "subscriptions");
			}

			_moduleManager.EnsureRegistered(module);

			lock (_subscriptionLock)
			{
				_outboundSubscriptions.AddRange(subscriptions);
			}

            _logger.LogDebug("Added subscription for outbound notification types {0} for module {1}",
                String.Join(",", subscriptions.Select(s => s.Type)),
                module.Name);
		}
		public void SubscribeToNotifications(ModuleDefinition module, params CustomNotificationSubscription[] subscriptions)
		{
			if (subscriptions == null || subscriptions.Length == 0)
			{
				throw new ArgumentException("At least one subscription should be specified", "subscriptions");
			}

			_moduleManager.EnsureRegistered(module);

			lock (_subscriptionLock)
			{
				_customSubscriptions.AddRange(subscriptions);
			}

            _logger.LogDebug("Exiting Notification Synchronise");
		}
		public RichMessageDeletedEvent(Guid[] messageIds, ModuleDefinition module)
		{
			DeletedMessageIds = messageIds;
			Publisher = module;
		}