Skip to content

Commit

Permalink
- released v3.4.2
Browse files Browse the repository at this point in the history
- added ESBResources.MessageHandlerFactoryHandlerRegistered
  • Loading branch information
eben-roux committed May 15, 2015
1 parent badf16d commit fee9f57
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 17 deletions.
9 changes: 9 additions & 0 deletions Shuttle.ESB.Core/ESBResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Shuttle.ESB.Core/ESBResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,8 @@
<value>No IUriResolver implementation has been configured. Cannot resolve uri name '{0}'.</value>
<comment>{0} = the uri name to resolve</comment>
</data>
<data name="MessageHandlerFactoryHandlerRegistered" xml:space="preserve">
<value>[message handler registered] : message type = '{0}' / handler type = '{1}'</value>
<comment>{0} = full name of message type, {1} = full name of handler type</comment>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private void AddMessageTypeHandler(Type messageType, Type messageHandlerType)

_messageHandlerTypes.Add(messageType, messageHandlerType);

_log.Information(string.Format("[add message handler] : message type = '{0}' / handler type = '{1}' ", messageType.FullName, messageHandlerType.FullName));
_log.Information(string.Format(ESBResources.MessageHandlerFactoryHandlerRegistered, messageType.FullName, messageHandlerType.FullName));
}

public override IMessageHandler CreateHandler(object message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace Shuttle.ESB.Core
{
public class WorkerAvailabilityManager : IWorkerAvailabilityManager
{
private static readonly object padlock = new object();
private static readonly object _padlock = new object();

private List<AvailableWorker> availableWorkers = new List<AvailableWorker>();
private List<AvailableWorker> _availableWorkers = new List<AvailableWorker>();

private readonly ILog _log;

Expand All @@ -19,26 +19,26 @@ public WorkerAvailabilityManager()

public AvailableWorker GetAvailableWorker()
{
lock (padlock)
lock (_padlock)
{
if (availableWorkers.Count == 0)
if (_availableWorkers.Count == 0)
{
return null;
}

var result = availableWorkers[0];
var result = _availableWorkers[0];

availableWorkers.RemoveAt(0);
_availableWorkers.RemoveAt(0);

return result;
}
}

public void WorkerAvailable(WorkerThreadAvailableCommand message)
{
lock (padlock)
lock (_padlock)
{
availableWorkers.Add(new AvailableWorker(message));
_availableWorkers.Add(new AvailableWorker(message));
}

if (_log.IsTraceEnabled)
Expand All @@ -54,19 +54,19 @@ public void ReturnAvailableWorker(AvailableWorker availableWorker)
return;
}

lock (padlock)
lock (_padlock)
{
availableWorkers.Add(availableWorker);
_availableWorkers.Add(availableWorker);
}
}

public void WorkerStarted(WorkerStartedEvent message)
{
lock (padlock)
lock (_padlock)
{
var result = new List<AvailableWorker>();

foreach (var availableWorker in availableWorkers)
foreach (var availableWorker in _availableWorkers)
{
if (
!(availableWorker.InboxWorkQueueUri.Equals(message.InboxWorkQueueUri,
Expand All @@ -77,7 +77,7 @@ public void WorkerStarted(WorkerStartedEvent message)
}
}

availableWorkers = result;
_availableWorkers = result;
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Shuttle.ESB.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
[assembly: AssemblyTitle("Shuttle.ESB.Core for .NET Framework 4.5.1")]
#endif

[assembly: AssemblyVersion("3.4.1.0")]
[assembly: AssemblyCopyright("Copyright © Eben Roux 2010-2014")]
[assembly: AssemblyVersion("3.4.2.0")]
[assembly: AssemblyCopyright("Copyright © Eben Roux 2010-2015")]
[assembly: AssemblyProduct("Shuttle.ESB")]
[assembly: AssemblyCompany("Shuttle")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyInformationalVersion("3.4.1")]
[assembly: AssemblyInformationalVersion("3.4.2")]
[assembly: ComVisible(false)]

0 comments on commit fee9f57

Please sign in to comment.