Permalink
Browse files

Merge branch 'master' of http://github.com/mnichols/rhino-esb

  • Loading branch information...
2 parents 2322754 + 5640525 commit 80153cef102c8915958b87ea6bda0bdc6bfed77c @ayende committed Aug 8, 2010
View
26 Rhino.ServiceBus.Tests/TwoBusesCommunicating.cs
@@ -51,6 +51,32 @@ public void Can_send_messages_from_one_end_to_the_other()
Assert.True(PongHandler.GotReply);
}
}
+ [Fact]
+ public void Can_notify_when_at_least_one_message_has_handler()
+ {
+ using(var bus1 = container1.Resolve<IStartableServiceBus>())
+ using(var bus2 = container2.Resolve<IStartableServiceBus>())
+ {
+ var subscriptionStorage2 = container2.Resolve<ISubscriptionStorage>();
+
+ var wait = new ManualResetEvent(false);
+ subscriptionStorage2.SubscriptionChanged += () => wait.Set();
+
+ bus1.Start();
+ bus2.Start();
+
+ PongHandler.ResetEvent = new ManualResetEvent(false);
+ PongHandler.GotReply = false;
+
+ wait.WaitOne(TimeSpan.FromSeconds(30), false);
+
+ bus2.Notify("ping", new Ping());
+
+ PongHandler.ResetEvent.WaitOne(TimeSpan.FromSeconds(30), false);
+
+ Assert.True(PongHandler.GotReply);
+ }
+ }
public class Ping
{
View
4 Rhino.ServiceBus/Config/MsmqTransportConfigurationAware.cs
@@ -71,8 +71,8 @@ public void Configure(AbstractRhinoServiceBusFacility facility, IConfiguration c
transactional = facility.Transactional,
consumeInTransaction = facility.ConsumeInTransaction,
}),
- AllTypes.Of<IMsmqTransportAction>()
- .FromAssembly(typeof(IMsmqTransportAction).Assembly)
+ AllTypes.FromAssembly(typeof(IMsmqTransportAction).Assembly)
+ .BasedOn<IMsmqTransportAction>()
.Unless(x => x == typeof(ErrorAction))
.WithService.FirstInterface()
.Configure(registration =>
View
8 Rhino.ServiceBus/Hosting/AbstractBootStrapper.cs
@@ -32,10 +32,10 @@ public void InitializeContainer(IWindsorContainer windsorContainer)
protected virtual void ConfigureContainer()
{
container.Register(
- AllTypes.Of<IDeploymentAction>()
- .FromAssembly(Assembly),
- AllTypes.Of<IEnvironmentValidationAction>()
- .FromAssembly(Assembly)
+ AllTypes.FromAssembly(Assembly)
+ .BasedOn<IDeploymentAction>(),
+ AllTypes.FromAssembly(Assembly)
+ .BasedOn<IEnvironmentValidationAction>()
);
RegisterConsumersFrom (Assembly);
}
View
6 Rhino.ServiceBus/Impl/AbstractRhinoServiceBusFacility.cs
@@ -80,8 +80,8 @@ protected override void Init()
ReadConfiguration();
Kernel.Register(
- AllTypes.Of<IBusConfigurationAware>()
- .FromAssembly(typeof(IBusConfigurationAware).Assembly)
+ AllTypes.FromAssembly(typeof(IBusConfigurationAware).Assembly)
+ .BasedOn<IBusConfigurationAware>()
);
foreach (var configurationAware in Kernel.ResolveAll<IBusConfigurationAware>())
@@ -92,7 +92,7 @@ protected override void Init()
foreach (var type in messageModules)
{
if (Kernel.HasComponent(type) == false)
- Kernel.AddComponent(type.FullName, type);
+ Kernel.Register(Component.For(type).Named(type.FullName));
}
RegisterComponents();
View
11 Rhino.ServiceBus/Impl/DefaultServiceBus.cs
@@ -350,8 +350,15 @@ private bool PublishInternal(object[] messages)
bool sentMsg = false;
if (messages.Length == 0)
throw new MessagePublicationException("Cannot publish an empty message batch");
- object msg = messages[0];
- IEnumerable<Uri> subscriptions = subscriptionStorage.GetSubscriptionsFor(msg.GetType());
+
+ var subscriptions = new HashSet<Uri>();
+ foreach (var message in messages)
+ {
+ foreach (var uri in subscriptionStorage.GetSubscriptionsFor(message.GetType()))
+ {
+ subscriptions.Add(uri);
+ }
+ }
foreach (Uri subscription in subscriptions)
{
transport.Send(endpointRouter.GetRoutedEndpoint(subscription), messages);
View
BIN SharedLibs/Castle.Core.dll
Binary file not shown.
View
BIN SharedLibs/Castle.Core.pdb
Binary file not shown.
View
41 SharedLibs/Castle.Core.xml
@@ -267,7 +267,7 @@
</member>
<member name="T:Castle.Components.DictionaryAdapter.KeyAttribute">
<summary>
- Assignes a specific dictionary key.
+ Assigns a specific dictionary key.
</summary>
</member>
<member name="M:Castle.Components.DictionaryAdapter.KeyAttribute.#ctor(System.String)">
@@ -276,6 +276,12 @@
</summary>
<param name="key">The key.</param>
</member>
+ <member name="M:Castle.Components.DictionaryAdapter.KeyAttribute.#ctor(System.String[])">
+ <summary>
+ Initializes a new instance of the <see cref="T:Castle.Components.DictionaryAdapter.KeyAttribute"/> class.
+ </summary>
+ <param name="keys">The compound key.</param>
+ </member>
<member name="T:Castle.Components.DictionaryAdapter.KeyPrefixAttribute">
<summary>
Assigns a prefix to the keyed properties of an interface.
@@ -1223,15 +1229,6 @@
Applied to the assemblies saved by <see cref="T:Castle.DynamicProxy.ModuleScope"/> in order to persist the cache data included in the persisted assembly.
</summary>
</member>
- <member name="M:Castle.DynamicProxy.Generators.InvocationTypeGenerator.GetBaseCtorArguments(System.Type,Castle.DynamicProxy.ProxyGenerationOptions,System.Reflection.ConstructorInfo@)">
- <summary>
- Generates the constructor for the class that extends
- <see cref="T:Castle.DynamicProxy.AbstractInvocation"/>
- </summary>
- <param name="targetFieldType"></param>
- <param name="proxyGenerationOptions"></param>
- <param name="baseConstructor"></param>
- </member>
<member name="T:Castle.DynamicProxy.Generators.BaseProxyGenerator">
<summary>
Base class that exposes the common functionalities
@@ -1255,6 +1252,15 @@
<param name="interface"></param>
<param name="mapping"></param>
</member>
+ <member name="M:Castle.DynamicProxy.Generators.InvocationTypeGenerator.GetBaseCtorArguments(System.Type,Castle.DynamicProxy.ProxyGenerationOptions,System.Reflection.ConstructorInfo@)">
+ <summary>
+ Generates the constructor for the class that extends
+ <see cref="T:Castle.DynamicProxy.AbstractInvocation"/>
+ </summary>
+ <param name="targetFieldType"></param>
+ <param name="proxyGenerationOptions"></param>
+ <param name="baseConstructor"></param>
+ </member>
<member name="T:Castle.DynamicProxy.DefaultProxyBuilder">
<summary>
Default implementation of <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> interface producing in-memory proxy assemblies.
@@ -2655,7 +2661,7 @@
</member>
<member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyTypeWithTargetInterface(System.Type,System.Type[],Castle.DynamicProxy.ProxyGenerationOptions)">
<summary>
- Creates the proxy type for interface proxy with target interface for given <paramref name="interfaceToProxy"/> interface, implementing given <paramref name="additionalInterfacesToProxy"/> and using provided <paramref name="options"/>.
+ Creates the proxy type for interface proxy with target interface for given <paramref name="interfaceToProxy"/> interface, implementing given <paramref name="additionalInterfacesToProxy"/> on given <paramref name="interfaceToProxy"/> and using provided <paramref name="options"/>.
</summary>
<param name="interfaceToProxy">The interface proxy type should implement.</param>
<param name="additionalInterfacesToProxy">The additional interfaces proxy type should implement.</param>
@@ -3025,11 +3031,6 @@
</para>
</remarks>
</member>
- <member name="T:Castle.Core.Logging.ConsoleFactory">
- <summary>
- Summary description for ConsoleFactory.
- </summary>
- </member>
<member name="T:Castle.Core.Logging.NullLogFactory">
<summary>
NullLogFactory used when logging is turned off.
@@ -4854,6 +4855,14 @@
Default <see cref="T:Castle.Core.Smtp.IEmailSender"/> implementation.
</summary>
</member>
+ <member name="M:Castle.Core.Smtp.DefaultSmtpSender.#ctor">
+ <summary>
+ Initializes a new instance of the <see cref="T:Castle.Core.Smtp.DefaultSmtpSender"/> class based on the <see cref="T:System.Net.Mail.SmtpClient"/> configuration provided in the application configuration file.
+ </summary>
+ <remarks>
+ This constructor is based on the default <see cref="T:System.Net.Mail.SmtpClient"/> configuration in the application configuration file.
+ </remarks>
+ </member>
<member name="M:Castle.Core.Smtp.DefaultSmtpSender.#ctor(System.String)">
<summary>
This service implementation
View
BIN SharedLibs/Castle.Windsor.dll
Binary file not shown.
View
BIN SharedLibs/Castle.Windsor.pdb
Binary file not shown.
View
4,788 SharedLibs/Castle.Windsor.xml
2,410 additions, 2,378 deletions not shown because the diff is too large. Please use a local Git client to view these changes.

0 comments on commit 80153ce

Please sign in to comment.