Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:mookid8000/Rebus

  • Loading branch information...
commit 32070e49c36fd5cce37aa300708ca176ddfdbf01 2 parents 6d1e636 + 5a12fdc
@mookid8000 mookid8000 authored
View
1  src/Rebus.Autofac/AutofacContainerAdapter.cs
@@ -39,6 +39,7 @@ public void SaveBusInstances(IBus bus, IAdvancedBus advancedBus)
var builder = new ContainerBuilder();
builder.RegisterInstance(bus).As<IBus>();
builder.RegisterInstance(advancedBus).As<IAdvancedBus>();
+ builder.Register(a => MessageContext.GetCurrent()).InstancePerDependency();
builder.Update(container);
}
}
View
3  src/Rebus.Castle.Windsor/WindsorContainerAdapter.cs
@@ -51,7 +51,8 @@ public void SaveBusInstances(IBus bus, IAdvancedBus advancedBus)
.Instance(advancedBus),
Component.For<IMessageContext>()
- .UsingFactoryMethod(k => MessageContext.GetCurrent()),
+ .UsingFactoryMethod(k => MessageContext.GetCurrent())
+ .LifestyleTransient(),
Component.For<InstanceDisposer>()
);
View
1  src/Rebus.Ninject/NinjectContainerAdapter.cs
@@ -33,6 +33,7 @@ public void SaveBusInstances(IBus bus, IAdvancedBus advancedBus)
{
kernel.Bind<IBus>().ToConstant(bus).InSingletonScope().Named("bus");
kernel.Bind<IAdvancedBus>().ToConstant(advancedBus).InSingletonScope().Named("advancedBus");
+ kernel.Bind<IMessageContext>().ToMethod(k => MessageContext.GetCurrent()).InTransientScope().Named("messageContext");
// We need to ensure that the kernel have resolved the interfaces once to make it control their lifetime
kernel.Get<IBus>();
View
1  src/Rebus.StructureMap/StructureMapContainerAdapter.cs
@@ -40,6 +40,7 @@ public void SaveBusInstances(IBus bus, IAdvancedBus advancedBus)
{
x.For<IBus>().Singleton().Add(bus);
x.For<IAdvancedBus>().Singleton().Add(advancedBus);
+ x.For<IMessageContext>().Transient().Use(MessageContext.GetCurrent);
});
}
}
View
1  src/Rebus.Unity/UnityContainerAdapter.cs
@@ -33,6 +33,7 @@ public void SaveBusInstances(IBus bus, IAdvancedBus advancedBus)
{
unityContainer.RegisterInstance(typeof(IBus), bus);
unityContainer.RegisterInstance(typeof(IAdvancedBus), advancedBus);
+ unityContainer.RegisterType<IMessageContext>(new InjectionFactory(c => MessageContext.GetCurrent()));
}
}
}
View
10 src/Rebus/Configuration/BuiltinContainerAdapter.cs
@@ -12,9 +12,15 @@ public class BuiltinContainerAdapter : IContainerAdapter, IDisposable
{
readonly SimpleHandlerActivator handlerActivator = new SimpleHandlerActivator();
- public IBus Bus { get; set; }
+ /// <summary>
+ /// Use this property to access the bus instance
+ /// </summary>
+ public IBus Bus { get; internal set; }
- public IAdvancedBus AdvancedBus { get; set; }
+ /// <summary>
+ /// Use this property to access the advanced bus, which is an ordinary bus plus some advanced operations
+ /// </summary>
+ public IAdvancedBus AdvancedBus { get; internal set; }
/// <summary>
/// Registers the given handler type. It is assumed that the type registered has a public
Please sign in to comment.
Something went wrong with that request. Please try again.