public static NotDisposed ( DisposableObject obj ) : void | ||
obj | DisposableObject | The object in question. |
Résultat | void |
/// <summary> /// Closes a channel, removing it from the message broker. /// </summary> /// <param name="name">The name of the channel to close.</param> public void CloseChannel(string name) { Ensure.NotDisposed(this); ThrowIfChannelDoesNotExist(name); IMessageChannel channel = _channels[name]; channel.Dispose(); _channels.Remove(name); }
/// <summary> /// Returns a channel with the specified name, creating it first if necessary. /// </summary> /// <param name="name">The name of the channel to create or retrieve.</param> /// <returns>The object representing the channel.</returns> public IMessageChannel GetChannel(string name) { Ensure.NotDisposed(this); if (!_channels.ContainsKey(name)) { var factory = Kernel.Components.Get <IMessageChannelFactory>(); _channels.Add(name, factory.Create(name)); } return(_channels[name]); }
/// <summary> /// Disables a channel, which will block messages from being passed. /// </summary> /// <param name="name">The name of the channel to disable.</param> public void DisableChannel(string name) { Ensure.NotDisposed(this); ThrowIfChannelDoesNotExist(name); _channels[name].Disable(); }