Creating Orchard.MessageBus

This commit is contained in:
Sebastien Ros
2014-09-24 18:16:08 -07:00
parent 6efbde45ac
commit 7a7528fa53
21 changed files with 900 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
using Orchard.Environment.Configuration;
using Orchard.Environment.Descriptor;
using Orchard.Environment.Descriptor.Models;
using Orchard.Environment.Extensions;
namespace Orchard.MessageBus.Services {
[OrchardFeature("Orchard.MessageBus.DistributedShellRestart")]
public class DistributedShellTrigger : IShellDescriptorManagerEventHandler, IShellSettingsManagerEventHandler {
private readonly IMessageBus _messageBus;
public DistributedShellTrigger(IShellSettingsManager shellSettingsManager, IMessageBus messageBus, IShellSettingsManagerEventHandler shellSettingsManagerEventHandler) {
_messageBus = messageBus;
}
void IShellDescriptorManagerEventHandler.Changed(ShellDescriptor descriptor, string tenant) {
_messageBus.Publish(DistributedShellStarter.Channel, tenant);
}
void IShellSettingsManagerEventHandler.Saved(ShellSettings settings) {
_messageBus.Publish(DistributedShellStarter.Channel, settings.Name);
}
}
}