Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moving to psake

restructuring project
removed DHT integration
  • Loading branch information...
commit 210d04785c31e331594024226563997f472b759f 1 parent 591d611
@ayende authored
Showing with 62,380 additions and 1,454 deletions.
  1. +11 −0 .gitignore
  2. +0 −70 Rhino.ServiceBus.DistributedHashTableIntegration/DhtClientSagaFacility.cs
  3. +0 −130 Rhino.ServiceBus.DistributedHashTableIntegration/DistributedHashTableSagaPersister.cs
  4. +0 −8 Rhino.ServiceBus.DistributedHashTableIntegration/ISagaStateMerger.cs
  5. +0 −10 Rhino.ServiceBus.DistributedHashTableIntegration/IVersionedSagaState.cs
  6. +0 −102 Rhino.ServiceBus.DistributedHashTableIntegration/OptimisticDistributedHashTableSagaPersister.cs
  7. +0 −85 Rhino.ServiceBus.DistributedHashTableIntegration/Rhino.ServiceBus.DistributedHashTableIntegration.csproj
  8. +0 −227 Rhino.ServiceBus.LogsService/MsmqLogReader.cs
  9. +0 −41 Rhino.ServiceBus.LogsService/Program.cs
  10. +0 −36 Rhino.ServiceBus.LogsService/Properties/AssemblyInfo.cs
  11. +0 −75 Rhino.ServiceBus.LogsService/Rhino.ServiceBus.LogsService.csproj
  12. +79 −81 Rhino.ServiceBus.Tests/DefaultReflectionTests.cs
  13. +0 −74 Rhino.ServiceBus.Tests/Dht/BaristaSaga.cs
  14. +0 −24 Rhino.ServiceBus.Tests/Dht/BaristaState.cs
  15. +0 −26 Rhino.ServiceBus.Tests/Dht/BaristaStateMerger.cs
  16. +0 −200 Rhino.ServiceBus.Tests/Dht/DistributedHashTableSagaPersisterTests.cs
  17. +0 −11 Rhino.ServiceBus.Tests/Dht/DrinkReady.cs
  18. +0 −29 Rhino.ServiceBus.Tests/Dht/InvalidBaristaSaga.cs
  19. +0 −10 Rhino.ServiceBus.Tests/Dht/PaymentComplete.cs
  20. +0 −18 Rhino.ServiceBus.Tests/Dht/PrepareDrink.cs
  21. +0 −28 Rhino.ServiceBus.Tests/Dht/UsageErrors.cs
  22. +3 −1 Rhino.ServiceBus.Tests/Hosting/Can_host_in_another_app_domain.cs
  23. +23 −36 Rhino.ServiceBus.Tests/Rhino.ServiceBus.Tests.csproj
  24. +0 −48 Rhino.ServiceBus.sln
  25. +7 −2 Rhino.ServiceBus/Hosting/RemoteAppDomainHost.cs
  26. +0 −4 Rhino.ServiceBus/Hosting/RemoteAppDomainLoadBalancerHost.cs
  27. +37 −35 Rhino.ServiceBus/Impl/DefaultReflection.cs
  28. +17 −19 Rhino.ServiceBus/Rhino.ServiceBus.csproj
  29. +6 −6 Rhino.ServiceBus/RhinoQueues/PhtSubscriptionStorage.cs
  30. +1 −0  Rhino.ServiceBus/RhinoQueues/RhinoQueuesTransport.cs
  31. +2 −0  Rhino.ServiceBus/RhinoQueues/TimeoutAction.cs
  32. +11 −7 Samples/Starbucks.Tests/Starbucks.Tests.csproj
  33. +15 −11 Samples/Starbucks/Starbucks.csproj
  34. BIN  SharedLibs/Castle.Core.dll
  35. +3,197 −0 SharedLibs/Castle.Core.xml
  36. BIN  SharedLibs/Castle.DynamicProxy2.dll
  37. +1,249 −0 SharedLibs/Castle.DynamicProxy2.xml
  38. BIN  SharedLibs/Castle.MicroKernel.dll
  39. +5,484 −0 SharedLibs/Castle.MicroKernel.xml
  40. BIN  SharedLibs/Castle.Windsor.dll
  41. +1,571 −0 SharedLibs/Castle.Windsor.xml
  42. BIN  SharedLibs/Esent.Interop.dll
  43. +9,521 −0 SharedLibs/Esent.Interop.xml
  44. BIN  SharedLibs/Rhino.DistributedHashTable.Client.dll
  45. BIN  SharedLibs/Rhino.DistributedHashTable.dll
  46. BIN  SharedLibs/Rhino.Mocks.dll
  47. +5,413 −0 SharedLibs/Rhino.Mocks.xml
  48. BIN  SharedLibs/Rhino.PersistentHashTable.dll
  49. BIN  SharedLibs/Rhino.Queues.dll
  50. BIN  SharedLibs/Wintellect.Threading.dll
  51. +3,330 −0 SharedLibs/Wintellect.Threading.xml
  52. BIN  SharedLibs/log4net.dll
  53. +28,655 −0 SharedLibs/log4net.xml
  54. BIN  SharedLibs/xunit.dll
  55. BIN  SharedLibs/xunit.extensions.dll
  56. BIN  Tools/xUnit/XUnit.NAntTasks.dll
  57. BIN  Tools/xUnit/xunit.console.exe
  58. +21 −0 Tools/xUnit/xunit.console.exe.config
  59. BIN  Tools/xUnit/xunit.dll
  60. BIN  Tools/xUnit/xunit.extensions.dll
  61. +705 −0 Tools/xUnit/xunit.extensions.xml
  62. BIN  Tools/xUnit/xunit.gui.exe
  63. BIN  Tools/xUnit/xunit.installer.exe
  64. BIN  Tools/xUnit/xunit.runner.msbuild.dll
  65. BIN  Tools/xUnit/xunit.runner.resharper.dll
  66. BIN  Tools/xUnit/xunit.runner.tdnet.dll
  67. BIN  Tools/xUnit/xunit.runner.utility.dll
  68. +407 −0 Tools/xUnit/xunit.runner.utility.xml
  69. +2,132 −0 Tools/xUnit/xunit.xml
  70. BIN  Tools/zip.exe
  71. +4 −0 acknowledgements.txt
  72. BIN  ayende-open-source.snk
  73. +103 −0 default.ps1
  74. +25 −0 license.txt
  75. +311 −0 psake.ps1
  76. +40 −0 psake_ext.ps1
View
11 .gitignore
@@ -0,0 +1,11 @@
+*resharper.user
+[Dd]ebug/
+[Rr]elease/
+build/
+[Bb]in/
+[Oo]bj/
+*.suo
+*.sln.cache
+_ReSharper.*/
+AssemblyInfo.cs
+*.user
View
70 Rhino.ServiceBus.DistributedHashTableIntegration/DhtClientSagaFacility.cs
@@ -1,70 +0,0 @@
-namespace Rhino.ServiceBus.DistributedHashTableIntegration
-{
- using System.Linq;
- using Castle.Core;
- using Castle.MicroKernel;
- using Castle.MicroKernel.Facilities;
- using DistributedHashTable;
- using Exceptions;
- using Internal;
- using Messages;
- using Sagas;
-
- public class DhtClientSagaFacility : AbstractFacility
- {
- private void Kernel_OnComponentRegistered(string key, IHandler handler)
- {
- var model = handler.ComponentModel;
-
- var list = model.Implementation.GetInterfaces()
- .Where(x => x.IsGenericType &&
- x.IsGenericTypeDefinition == false &&
- x.GetGenericTypeDefinition() == typeof(ISaga<>))
- .ToList();
-
- if (list.Count == 0)
- return;
-
- if (list.Count > 1)
- {
- throw new InvalidUsageException(model.Implementation +
- " implements more than one ISaga<T>, this is not permitted");
- }
-
- var sagaType = list[0];
- var sagaStateType = sagaType.GetGenericArguments()[0];
-
- if (typeof(Orchestrates<MergeSagaState>).IsAssignableFrom(model.Implementation))
- {
- Kernel.AddComponent(
- "SagaPersister<" + model.Implementation + ">",
- typeof(ISagaPersister<>)
- .MakeGenericType(model.Implementation),
- typeof(DistributedHashTableSagaPersister<,>)
- .MakeGenericType(model.Implementation, sagaStateType)
- );
- }
- else if (typeof(SupportsOptimisticConcurrency).IsAssignableFrom(model.Implementation))
- {
- Kernel.AddComponent(
- "SagaPersister<" + model.Implementation + ">",
- typeof(ISagaPersister<>)
- .MakeGenericType(model.Implementation),
- typeof(OptimisticDistributedHashTableSagaPersister<,>)
- .MakeGenericType(model.Implementation, sagaStateType)
- );
- }
- else
- {
- throw new InvalidUsageException(
- "When using DHT for saga state, you must implement either SupportsOptimisticConcurrency or Orchestrates<MergeSagaState>");
- }
- }
-
- protected override void Init()
- {
- Kernel.ComponentRegistered += Kernel_OnComponentRegistered;
- Kernel.AddComponent("dht", typeof(IDistributedHashTableClient), typeof(DistributedHashTableClient));
- }
- }
-}
View
130 Rhino.ServiceBus.DistributedHashTableIntegration/DistributedHashTableSagaPersister.cs
@@ -1,130 +0,0 @@
-using System;
-using System.IO;
-using Rhino.ServiceBus.Internal;
-using System.Linq;
-using Rhino.ServiceBus.Messages;
-
-namespace Rhino.ServiceBus.DistributedHashTableIntegration
-{
- using Castle.MicroKernel;
- using DistributedHashTable;
- using PersistentHashTable;
- using Sagas;
-
- public class DistributedHashTableSagaPersister<TSaga, TState> : ISagaPersister<TSaga>
- where TSaga : class, ISaga<TState>
- where TState : IVersionedSagaState
- {
- private readonly IDistributedHashTableClient distributedHashTable;
- private readonly ISagaStateMerger<TState> stateMerger;
- private readonly IMessageSerializer messageSerializer;
- private readonly IKernel kernel;
- private readonly IServiceBus bus;
- private readonly IReflection reflection;
-
- public DistributedHashTableSagaPersister(IDistributedHashTableClient distributedHashTable, ISagaStateMerger<TState> stateMerger, IMessageSerializer messageSerializer, IKernel kernel, IReflection reflection, IServiceBus bus)
- {
- this.distributedHashTable = distributedHashTable;
- this.bus = bus;
- this.stateMerger = stateMerger;
- this.messageSerializer = messageSerializer;
- this.kernel = kernel;
- this.reflection = reflection;
- }
-
-
- private static string CreateKey(Guid id)
- {
- return typeof(TSaga).FullName + "-" + id;
- }
-
-
- public TSaga Get(Guid id)
- {
- var values = distributedHashTable.Get(new[]
- {
- new GetRequest{Key = CreateKey(id)},
- }).First();
- if (values.Length == 0)
- return null;
- TState state;
- if (values.Length != 1)
- {
- var states = new TState[values.Length];
- for (var i = 0; i < values.Length; i++)
- {
- var value = values[i];
- using (var ms = new MemoryStream(value.Data))
- {
- object[] msgs = messageSerializer.Deserialize(ms);
- states[i] = (TState)msgs[0];
- states[i].ParentVersions = value.ParentVersions;
- states[i].Version = value.Version;
- }
- }
- state = stateMerger.Merge(states);
- state.ParentVersions = values
- .Select(x => x.Version)
- .ToArray();
- }
- else
- {
- using (var ms = new MemoryStream(values[0].Data))
- {
- object[] msgs = messageSerializer.Deserialize(ms);
- state = (TState)msgs[0];
- state.ParentVersions = new[] { values[0].Version };
- }
- }
- var saga = kernel.Resolve<TSaga>();
- saga.Id = id;
- reflection.Set(saga, "State", type => state);
- return saga;
- }
-
- public void Save(TSaga saga)
- {
- using (var message = new MemoryStream())
- {
- var state = (TState)reflection.Get(saga, "State");
- messageSerializer.Serialize(new object[] { state }, message);
- var putResults = distributedHashTable.Put(new[]
- {
- new PutRequest
- {
- Bytes = message.ToArray(),
- Key = CreateKey(saga.Id),
- ParentVersions = state.ParentVersions ?? new ValueVersion[0]
- },
- });
- if(putResults[0].ConflictExists)
- {
- bus.Send(bus.Endpoint, new MergeSagaState
- {
- CorrelationId = saga.Id
- });
- }
- }
- }
-
- public void Complete(TSaga saga)
- {
- var state = (TState) reflection.Get(saga, "State");
- var removed = distributedHashTable.Remove(new[]
- {
- new RemoveRequest
- {
- Key = CreateKey(saga.Id),
- ParentVersions = state.ParentVersions ?? new ValueVersion[0]
- },
- });
- if (removed[0] == false)
- {
- bus.Send(bus.Endpoint, new MergeSagaState
- {
- CorrelationId = saga.Id
- });
- }
- }
- }
-}
View
8 Rhino.ServiceBus.DistributedHashTableIntegration/ISagaStateMerger.cs
@@ -1,8 +0,0 @@
-namespace Rhino.ServiceBus.DistributedHashTableIntegration
-{
- public interface ISagaStateMerger<TState>
- where TState : IVersionedSagaState
- {
- TState Merge(TState[] states);
- }
-}
View
10 Rhino.ServiceBus.DistributedHashTableIntegration/IVersionedSagaState.cs
@@ -1,10 +0,0 @@
-namespace Rhino.ServiceBus.DistributedHashTableIntegration
-{
- using PersistentHashTable;
-
- public interface IVersionedSagaState
- {
- ValueVersion Version { get; set; }
- ValueVersion[] ParentVersions { get; set; }
- }
-}
View
102 ...ServiceBus.DistributedHashTableIntegration/OptimisticDistributedHashTableSagaPersister.cs
@@ -1,102 +0,0 @@
-using System;
-using System.IO;
-using System.Linq;
-using Castle.MicroKernel;
-using Rhino.ServiceBus.Exceptions;
-using Rhino.ServiceBus.Internal;
-
-namespace Rhino.ServiceBus.DistributedHashTableIntegration
-{
- using DistributedHashTable;
- using PersistentHashTable;
- using Sagas;
-
- public class OptimisticDistributedHashTableSagaPersister<TSaga, TState> : ISagaPersister<TSaga>
- where TSaga : class, ISaga<TState>
- where TState : IVersionedSagaState
- {
- private readonly IDistributedHashTableClient distributedHashTable;
- private readonly IReflection reflection;
- private readonly IMessageSerializer messageSerializer;
- private readonly IKernel kernel;
-
- public OptimisticDistributedHashTableSagaPersister(IDistributedHashTableClient distributedHashTable, IReflection reflection, IMessageSerializer messageSerializer, IKernel kernel)
- {
- this.distributedHashTable = distributedHashTable;
- this.reflection = reflection;
- this.messageSerializer = messageSerializer;
- this.kernel = kernel;
- }
-
- private static string CreateKey(Guid id)
- {
- return typeof(TSaga).FullName + "-" + id;
- }
-
- public TSaga Get(Guid id)
- {
- var values = distributedHashTable.Get(new[]
- {
- new GetRequest {Key = CreateKey(id)},
- }).First();
-
- if(values.Length==0)
- return null;
-
- var value = values[0];
-
- TState state;
- using (var ms = new MemoryStream(value.Data))
- {
- var msgs = messageSerializer.Deserialize(ms);
- state = (TState)msgs[0];
- state.Version = value.Version;
- state.ParentVersions = value.ParentVersions;
- }
- var saga = kernel.Resolve<TSaga>();
- saga.Id = id;
- reflection.Set(saga, "State", type => state);
- return saga;
- }
-
- public void Save(TSaga saga)
- {
- using (var message = new MemoryStream())
- {
- var state = (TState)reflection.Get(saga, "State");
- messageSerializer.Serialize(new object[] { state }, message);
- var putResults = distributedHashTable.Put(new[]
- {
- new PutRequest
- {
- Bytes = message.ToArray(),
- Key = CreateKey(saga.Id),
- OptimisticConcurrency = true,
- ParentVersions = (state.Version != null ? new[] { state.Version } : new ValueVersion[0])
- },
- });
- if (putResults[0].ConflictExists)
- {
- throw new OptimisticConcurrencyException("Saga state is not the latest: " + saga.Id);
- }
- }
- }
-
- public void Complete(TSaga saga)
- {
- var state = (TState) reflection.Get(saga, "State");
- var removed = distributedHashTable.Remove(new[]
- {
- new RemoveRequest
- {
- Key = CreateKey(saga.Id),
- ParentVersions = new []{state.Version}
- },
- });
- if (removed[0] == false)
- {
- throw new OptimisticConcurrencyException("Saga state is not the latest: " + saga.Id);
- }
- }
- }
-}
View
85 ...s.DistributedHashTableIntegration/Rhino.ServiceBus.DistributedHashTableIntegration.csproj
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{CBBB042F-D5E4-4BCD-AE95-D6D886DA8222}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Rhino.ServiceBus.DistributedHashTableIntegration</RootNamespace>
- <AssemblyName>Rhino.ServiceBus.DistributedHashTableIntegration</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\SharedLibs\Castle\Castle.Core.dll</HintPath>
- </Reference>
- <Reference Include="Castle.MicroKernel, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\SharedLibs\Castle\Castle.MicroKernel.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Xml.Linq">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data.DataSetExtensions">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="DhtClientSagaFacility.cs" />
- <Compile Include="DistributedHashTableSagaPersister.cs" />
- <Compile Include="ISagaStateMerger.cs" />
- <Compile Include="IVersionedSagaState.cs" />
- <Compile Include="OptimisticDistributedHashTableSagaPersister.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\pht\Rhino.PersistentHashTable\Rhino.PersistentHashTable.csproj">
- <Project>{F30B2D63-CED5-4C8A-908F-0B5503D984A9}</Project>
- <Name>Rhino.PersistentHashTable</Name>
- </ProjectReference>
- <ProjectReference Include="..\Rhino.DistributedHashTable\Rhino.DistributedHashTable.csproj">
- <Project>{63530BA6-3424-49D9-B32C-A35A603817CE}</Project>
- <Name>Rhino.DistributedHashTable</Name>
- </ProjectReference>
- <ProjectReference Include="..\Rhino.ServiceBus\Rhino.ServiceBus.csproj">
- <Project>{1B21C8A5-5E0E-412B-A7F4-9F28B4427F21}</Project>
- <Name>Rhino.ServiceBus</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
View
227 Rhino.ServiceBus.LogsService/MsmqLogReader.cs
@@ -1,227 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Messaging;
-using System.Threading;
-using System.Xml;
-using System.Xml.Linq;
-using log4net;
-using Lucene.Net.Analysis.Standard;
-using Lucene.Net.Documents;
-using Lucene.Net.Index;
-using Rhino.ServiceBus.Msmq;
-
-namespace Rhino.ServiceBus.LogsService
-{
- public class MsmqLogReader : IDisposable
- {
- private readonly string indexDirectory;
- private readonly ILog logger = LogManager.GetLogger(typeof(MsmqLogReader));
- private readonly Uri logQueue;
- private readonly ManualResetEvent resetEvent = new ManualResetEvent(false);
-
- private int batchCount;
- private MessageQueue queue;
-
- public MsmqLogReader(Uri logQueue)
- {
- this.logQueue = logQueue;
- indexDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "messages");
- }
-
- private bool ShouldStop { get; set; }
-
- #region IDisposable Members
-
- public void Dispose()
- {
- ShouldStop = true;
- resetEvent.WaitOne();
- if (queue != null)
- queue.Dispose();
- }
-
- #endregion
-
- public void Start()
- {
- string queuePath = MsmqUtil.GetQueuePath(logQueue);
- queue = new MessageQueue(queuePath, QueueAccessMode.Receive);
-
- new IndexWriter(indexDirectory, new StandardAnalyzer(), true).Close(true);
-
- queue.BeginPeek(TimeSpan.FromSeconds(1), new QueueState { Queue = queue, WaitHandle = resetEvent },
- OnPeekMessage);
- }
-
- private void OnPeekMessage(IAsyncResult ar)
- {
- Message message;
- bool? peek = TryEndingPeek(ar, out message);
- if (peek == false) // error
- return;
-
- var state = (QueueState)ar.AsyncState;
- if (ShouldStop)
- {
- state.WaitHandle.Set();
- return;
- }
-
- if (peek == null) //nothing was found
- {
- state.Queue.BeginPeek(TimeSpan.FromSeconds(1), state, OnPeekMessage);
- return;
- }
- try
- {
- try
- {
- ProcessMessages(state);
- }
- catch (MessageQueueException e)
- {
- if (e.MessageQueueErrorCode != MessageQueueErrorCode.IOTimeout)
- throw;
- }
- }
- catch (Exception e)
- {
- logger.Error("Error when trying to index messages from queue", e);
- }
- state.Queue.BeginPeek(TimeSpan.FromSeconds(1), state, OnPeekMessage);
- }
-
- /// <summary>
- /// try to read a 100 messages, translate to lucene docs, then write
- /// to index
- /// </summary>
- /// <param name="state"></param>
- private void ProcessMessages(QueueState state)
- {
- int count = 100;
- var list = new List<Message>();
-
- using (MessageEnumerator enumerator = state.Queue.GetMessageEnumerator2())
- {
- if (enumerator.MoveNext() == false)
- return;
- while(count > 0)
- {
- try
- {
- list.Add(enumerator.RemoveCurrent());
- }
- catch(MessageQueueException e)
- {
- if (e.MessageQueueErrorCode != MessageQueueErrorCode.IOTimeout)
- break;
- throw;
- }
- }
-
- var writer = new IndexWriter(indexDirectory, new StandardAnalyzer(), false);
- try
- {
- foreach (Message message in list)
- {
- writer.AddDocument(GetLuceneDocument(message));
- }
-
- if (Interlocked.Increment(ref batchCount) % 15 == 0)
- writer.Optimize(true);
- }
- finally
- {
- writer.Close(true);
- }
- }
- }
-
- private Document GetLuceneDocument(Message message)
- {
- XDocument document = XDocument.Load(XmlReader.Create(message.BodyStream));
- var luceneDoc = new Document();
-
- foreach (XElement element in document.Root.Elements())
- {
- string name = element.Name.LocalName;
- luceneDoc.Add(new Field(
- "MessageAction",
- name,
- Field.Store.YES,
- Field.Index.TOKENIZED));
- logger.DebugFormat("Indexing {0} message", name);
- foreach (XElement value in element.Elements())
- {
- switch (value.Name.LocalName)
- {
- case "MessageId":
- case "CorrelationId":
- case "Source":
- case "Timestamp":
- luceneDoc.Add(new Field(
- value.Name.LocalName,
- value.Value,
- Field.Store.YES,
- Field.Index.TOKENIZED));
- break;
- case "MessageType":
- luceneDoc.Add(new Field(
- value.Name.LocalName,
- value.Value,
- Field.Store.YES,
- Field.Index.TOKENIZED));
- break;
- case "Message":
- luceneDoc.Add(new Field(
- value.Name.LocalName,
- value.ToString(),
- //Field.Store.COMPRESS,
- Field.Store.YES,
- Field.Index.TOKENIZED));
- break;
- default:
- luceneDoc.Add(new Field(
- value.Name.LocalName,
- value.ToString(),
- Field.Store.YES,
- Field.Index.UN_TOKENIZED));
- break;
- }
- }
- }
- return luceneDoc;
- }
-
- private bool? TryEndingPeek(IAsyncResult ar, out Message message)
- {
- var state = (QueueState)ar.AsyncState;
- try
- {
- message = state.Queue.EndPeek(ar);
- }
- catch (MessageQueueException e)
- {
- message = null;
- if (e.MessageQueueErrorCode != MessageQueueErrorCode.IOTimeout)
- {
- logger.Error("Could not peek message from queue", e);
- return false;
- }
- return null; // nothing found
- }
- return true;
- }
-
- #region Nested type: QueueState
-
- private class QueueState
- {
- public MessageQueue Queue;
- public ManualResetEvent WaitHandle;
- }
-
- #endregion
- }
-}
View
41 Rhino.ServiceBus.LogsService/Program.cs
@@ -1,41 +0,0 @@
-using System;
-using log4net.Config;
-using Lucene.Net.Analysis.Standard;
-using Lucene.Net.Documents;
-using Lucene.Net.Index;
-using Lucene.Net.QueryParsers;
-using Lucene.Net.Search;
-
-namespace Rhino.ServiceBus.LogsService
-{
- public class Program
- {
- public static void Main(string[] args)
- {
- BasicConfigurator.Configure();
- //using (var reader = new MsmqLogReader(new Uri("msmq://localhost/test_queue2")))
- //{
- // reader.Start();
-
- // Console.ReadLine();
- //}
-
- var searcher = new IndexSearcher("messages");
- var parser = new QueryParser("", new StandardAnalyzer());
- //var query = parser.Parse("MessageId:\"b5005080-800c-43c3-a20b-16db773d7663\" AND MessageId:2307015");
- var query = parser.Parse("Timestamp:[\"2008-12-16T08:14:53.9749900\" TO \"2008-12-16T08:14:53.6343650\"]");
-
- var hits = searcher.Search(query);
- for (int i = 0; i < hits.Length(); i++)
- {
- var doc = hits.Doc(i);
- Console.WriteLine();
- foreach (Fieldable field in doc.GetFields())
- {
- Console.WriteLine("{0}: {1}", field.Name(), field.StringValue());
- }
- Console.WriteLine();
- }
- }
- }
-}
View
36 Rhino.ServiceBus.LogsService/Properties/AssemblyInfo.cs
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Rhino.ServiceBus.LogsService")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Rhino.ServiceBus.LogsService")]
-[assembly: AssemblyCopyright("Copyright © 2008")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("f63a2850-daaf-485e-a537-0f95414ee649")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
View
75 Rhino.ServiceBus.LogsService/Rhino.ServiceBus.LogsService.csproj
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{EFDDAF65-9637-4696-B3FA-2738D5990AE9}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Rhino.ServiceBus.LogsService</RootNamespace>
- <AssemblyName>Rhino.ServiceBus.LogsService</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <StartupObject>
- </StartupObject>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\SharedLibs\log4net.dll</HintPath>
- </Reference>
- <Reference Include="Lucene.Net, Version=2.3.1.3, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\SharedLibs\Lucene.Net.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Messaging" />
- <Reference Include="System.Transactions" />
- <Reference Include="System.Xml.Linq">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data.DataSetExtensions">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="..\Rhino.ServiceBus\Msmq\MsmqUtil.cs">
- <Link>MsmqUtil.cs</Link>
- </Compile>
- <Compile Include="MsmqLogReader.cs" />
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
View
160 Rhino.ServiceBus.Tests/DefaultReflectionTests.cs
@@ -20,20 +20,20 @@ public void Can_roundtrip_uri()
Assert.NotNull(type);
}
- [Fact]
- public void Message_type_harvesting_returns_consumers()
- {
- var types = reflection.GetMessagesConsumed(typeof(SomeMsgConsumer), t => false);
- Assert.Equal(1,types.Length);
- Assert.Equal(types[0],typeof(SomeMsg));
- }
-
- [Fact]
- public void Message_type_harvesting_ignores_open_generic_consumers()
- {
- var types = reflection.GetMessagesConsumed(typeof(GenericConsumer<>), t => false);
- Assert.Empty(types);
- }
+ [Fact]
+ public void Message_type_harvesting_returns_consumers()
+ {
+ var types = reflection.GetMessagesConsumed(typeof(SomeMsgConsumer), t => false);
+ Assert.Equal(1, types.Length);
+ Assert.Equal(types[0], typeof(SomeMsg));
+ }
+
+ [Fact]
+ public void Message_type_harvesting_ignores_open_generic_consumers()
+ {
+ var types = reflection.GetMessagesConsumed(typeof(GenericConsumer<>), t => false);
+ Assert.Empty(types);
+ }
[Fact]
public void Will_throw_inner_exception_for_add()
@@ -64,71 +64,69 @@ public void Will_throw_inner_exception_for_save()
{
Assert.Throws<NotImplementedException>(() => reflection.InvokeSagaPersisterSave(new ThrowingPersister(), new ThrowingList()));
}
- [Fact]
- public void Gets_assembly_name_without_version_for_generic_lists()
- {
- var list = new List<SomeMsg>();
- var output = reflection.GetAssemblyQualifiedNameWithoutVersion(list.GetType());
-
- Assert.DoesNotContain("Rhino.ServiceBus.Tests,Version=",output.Replace(" ",""));
- }
- [Fact]
- public void Gets_assembly_name_without_version_for_generic_types_in_local_assemblies()
- {
- var output = reflection.GetAssemblyQualifiedNameWithoutVersion(typeof(GenericConsumer<SomeMsg>));
-
- Assert.DoesNotContain("Rhino.ServiceBus.Tests,Version=", output.Replace(" ", ""));
- Assert.NotNull(Type.GetType(output)); // still fail!!!
- }
- [Fact]
- public void Gets_assembly_name_with_more_than_one_type_parameter()
- {
- string name = reflection.GetAssemblyQualifiedNameWithoutVersion(typeof(Dictionary<object, object>));
- Assert.Equal(
- typeof(Dictionary<object, object>).AssemblyQualifiedName,
- name);
- var type = Type.GetType(name);
- }
-<<<<<<< .mine
-
- [Fact]
- public void Gets_assembly_name_without_version_for_generic_types_with_more_than_one_type_parameter_in_local_assemblies()
- {
- string name = reflection.GetAssemblyQualifiedNameWithoutVersion(typeof(TestDictionary<string, string>));
- var type = Type.GetType(name);
- Assert.NotNull(type); // fail if not apply my fix!!!
- }
-
-
-
-=======
- [Fact]
- public void Gets_all_consumers_for_message_type_with_interface_and_base_class()
- {
- var consumers = reflection.GetGenericTypesOfWithBaseTypes(typeof(ConsumerOf<>), new SomeMsg2());
- Assert.Equal(4, consumers.Count);
- Assert.Contains(typeof(ConsumerOf<SomeMsg2>), consumers);
- Assert.Contains(typeof(ConsumerOf<SomeMsg>), consumers);
- Assert.Contains(typeof(ConsumerOf<IAmASpecialMessage>), consumers);
- Assert.Contains(typeof(ConsumerOf<object>), consumers);
- }
-
->>>>>>> .theirs
- public class SomeMsg{}
- public class SomeMsgConsumer:GenericConsumer<SomeMsg>{}
- public class GenericConsumer<T>:ConsumerOf<T>
- {
- public void Consume(T message)
- {
- }
- }
-
- public interface IAmASpecialMessage{}
-
- public class SomeMsg2 : SomeMsg, IAmASpecialMessage{}
-
- public class SomeMsg2Consumer : GenericConsumer<SomeMsg2> { }
- public class IAmASpecialMessageConsumer : GenericConsumer<IAmASpecialMessage> { }
+ [Fact]
+ public void Gets_assembly_name_without_version_for_generic_lists()
+ {
+ var list = new List<SomeMsg>();
+ var output = reflection.GetAssemblyQualifiedNameWithoutVersion(list.GetType());
+
+ Assert.DoesNotContain("Rhino.ServiceBus.Tests,Version=", output.Replace(" ", ""));
+ }
+ [Fact]
+ public void Gets_assembly_name_without_version_for_generic_types_in_local_assemblies()
+ {
+ var output = reflection.GetAssemblyQualifiedNameWithoutVersion(typeof(GenericConsumer<SomeMsg>));
+
+ Assert.DoesNotContain("Rhino.ServiceBus.Tests,Version=", output.Replace(" ", ""));
+ Assert.NotNull(Type.GetType(output)); // still fail!!!
+ }
+
+ [Fact]
+ public void Gets_assembly_name_with_more_than_one_type_parameter()
+ {
+ string name = reflection.GetAssemblyQualifiedNameWithoutVersion(typeof(Dictionary<object, object>));
+ Assert.Equal(
+ typeof(Dictionary<object, object>).AssemblyQualifiedName,
+ name);
+ var type = Type.GetType(name);
+ }
+
+ [Fact]
+ public void Gets_assembly_name_without_version_for_generic_types_with_more_than_one_type_parameter_in_local_assemblies()
+ {
+ string name = reflection.GetAssemblyQualifiedNameWithoutVersion(typeof(TestDictionary<string, string>));
+ var type = Type.GetType(name);
+ Assert.NotNull(type); // fail if not apply my fix!!!
+ }
+
+
+
+ [Fact]
+ public void Gets_all_consumers_for_message_type_with_interface_and_base_class()
+ {
+ var consumers = reflection.GetGenericTypesOfWithBaseTypes(typeof(ConsumerOf<>), new SomeMsg2());
+ Assert.Equal(4, consumers.Count);
+ Assert.Contains(typeof(ConsumerOf<SomeMsg2>), consumers);
+ Assert.Contains(typeof(ConsumerOf<SomeMsg>), consumers);
+ Assert.Contains(typeof(ConsumerOf<IAmASpecialMessage>), consumers);
+ Assert.Contains(typeof(ConsumerOf<object>), consumers);
+ }
+
+ public class SomeMsg { }
+ public class SomeMsgConsumer : GenericConsumer<SomeMsg> { }
+ public class GenericConsumer<T> : ConsumerOf<T>
+ {
+ public void Consume(T message)
+ {
+ }
+ }
+
+ public interface IAmASpecialMessage { }
+
+ public class SomeMsg2 : SomeMsg, IAmASpecialMessage { }
+
+ public class SomeMsg2Consumer : GenericConsumer<SomeMsg2> { }
+ public class IAmASpecialMessageConsumer : GenericConsumer<IAmASpecialMessage> { }
public class ThrowingConsumer : ConsumerOf<string>
{
@@ -163,7 +161,7 @@ public int State
set { throw new System.NotImplementedException(); }
}
}
-
+
public class ThrowingPersister : ISagaPersister<DefaultReflectionTests.ThrowingList>
{
public ThrowingList Get(Guid id)
@@ -187,5 +185,5 @@ public class TestDictionary<T, TK> : Dictionary<T, TK>
}
-
+
}
View
74 Rhino.ServiceBus.Tests/Dht/BaristaSaga.cs
@@ -1,74 +0,0 @@
-using System;
-using System.Threading;
-using Rhino.ServiceBus.Messages;
-using Rhino.ServiceBus.Sagas;
-
-namespace Rhino.ServiceBus.Tests.Dht
-{
- public class BaristaSaga :
- ISaga<BaristaState>,
- InitiatedBy<PrepareDrink>,
- Orchestrates<PaymentComplete>,
- Orchestrates<MergeSagaState>
- {
- public static ManualResetEvent FinishedConsumingMessage;
- public static ManualResetEvent WaitToCreateConflicts;
-
- public static Guid SagaId { get; set; }
- public static string DrinkName;
-
- private readonly IServiceBus bus;
-
- public BaristaSaga(IServiceBus bus)
- {
- this.bus = bus;
- State = new BaristaState();
- }
-
- #region InitiatedBy<PrepareDrink> Members
-
- public void Consume(PrepareDrink message)
- {
- State.Drink = message.DrinkName;
-
- State.DrinkIsReady = true;
- SubmitOrderIfDone();
- }
-
- #endregion
-
- public BaristaState State { get; set; }
-
- public Guid Id { get; set; }
-
- public bool IsCompleted { get; set; }
-
- public void Consume(PaymentComplete message)
- {
- State.GotPayment = true;
- SubmitOrderIfDone();
- }
-
- private void SubmitOrderIfDone()
- {
- if (State.GotPayment && State.DrinkIsReady)
- {
- bus.Publish(new DrinkReady
- {
- CorrelationId = Id,
- Drink = State.Drink
- });
- IsCompleted = true;
- }
- SagaId = Id;
- FinishedConsumingMessage.Set();
- WaitToCreateConflicts.WaitOne(TimeSpan.FromSeconds(30), false);
- }
-
- public void Consume(MergeSagaState message)
- {
- DrinkName = State.Drink;
- FinishedConsumingMessage.Set();
- }
- }
-}
View
24 Rhino.ServiceBus.Tests/Dht/BaristaState.cs
@@ -1,24 +0,0 @@
-using Rhino.ServiceBus.Sagas;
-
-namespace Rhino.ServiceBus.Tests.Dht
-{
- using DistributedHashTableIntegration;
- using PersistentHashTable;
-
- public class BaristaState : IVersionedSagaState
- {
- public bool DrinkIsReady { get; set; }
-
- public bool GotPayment { get; set; }
-
- public string Drink { get; set; }
-
- #region IVersionedSagaState Members
-
- public ValueVersion Version { get; set; }
-
- public ValueVersion[] ParentVersions { get; set; }
-
- #endregion
- }
-}
View
26 Rhino.ServiceBus.Tests/Dht/BaristaStateMerger.cs
@@ -1,26 +0,0 @@
-using Rhino.ServiceBus.Sagas;
-using System.Linq;
-
-namespace Rhino.ServiceBus.Tests.Dht
-{
- using DistributedHashTableIntegration;
-
- public class BaristaStateMerger : ISagaStateMerger<BaristaState>
- {
- public BaristaState Merge(BaristaState[] states)
- {
- var merged = new BaristaState();
- foreach (var state in states)
- {
- if(state.DrinkIsReady)
- merged.DrinkIsReady = true;
- if(state.GotPayment)
- merged.GotPayment = true;
- }
- merged.Drink = states
- .OrderByDescending(x => x.Version)
- .First().Drink;
- return merged;
- }
- }
-}
View
200 Rhino.ServiceBus.Tests/Dht/DistributedHashTableSagaPersisterTests.cs
@@ -1,200 +0,0 @@
-using System;
-using System.ComponentModel.Design;
-using System.IO;
-using System.Threading;
-using Castle.Windsor;
-using Castle.Windsor.Configuration.Interpreters;
-using Rhino.ServiceBus.Impl;
-using Rhino.ServiceBus.Internal;
-using Rhino.ServiceBus.Sagas;
-using Xunit;
-using System.Linq;
-
-namespace Rhino.ServiceBus.Tests.Dht
-{
- using DistributedHashTable;
- using DistributedHashTableIntegration;
- using PersistentHashTable;
- using Rhino.ServiceBus.Hosting;
-
- public class DistributedHashTableSagaPersisterTests : MsmqTestBase,
- OccasionalConsumerOf<DrinkReady>
- {
- private readonly IWindsorContainer container;
- private readonly RemoteAppDomainHost host;
-
- public DistributedHashTableSagaPersisterTests()
- {
- Delete("cache.esent");
- BaristaSaga.WaitToCreateConflicts = new ManualResetEvent(true);
- BaristaSaga.FinishedConsumingMessage = new ManualResetEvent(false);
- container = new WindsorContainer(new XmlInterpreter());
- container.Kernel.AddFacility("rhino.esb",
- new RhinoServiceBusFacility()
- );
- container.Kernel.AddFacility("dht.saga", new DhtClientSagaFacility());
- container.AddComponent<BaristaSaga>();
- container.AddComponent<ISagaStateMerger<BaristaState>, BaristaStateMerger>();
-
- host = new RemoteAppDomainHost(
- typeof (DhtBootStrapper).Assembly.Location,
- Path.Combine(Path.GetDirectoryName(typeof (DhtBootStrapper).Assembly.Location), "DhtService.config")
- );
- host.Start();
- }
-
- private void Delete(string database)
- {
- if(Directory.Exists(database))
- Directory.Delete(database, true);
- }
-
- [Fact]
- public void Will_put_saga_state_in_dht()
- {
- var guid = Guid.NewGuid();
- using (var bus = container.Resolve<IStartableServiceBus>())
- {
- bus.Start();
-
- bus.Send(bus.Endpoint, new PrepareDrink
- {
- CorrelationId = guid,
- CustomerName = "ayende",
- DrinkName = "Coffee"
- });
-
- BaristaSaga.FinishedConsumingMessage.WaitOne(TimeSpan.FromSeconds(30), false);
- }
-
- var distributedHashTable = container.Resolve<IDistributedHashTableClient>();
- Value[] values;
-
- do
- {
- Thread.Sleep(100);
- values = distributedHashTable.Get(new[]
- {
- new GetRequest
- {
- Key = typeof(BaristaSaga) + "-" + guid
- },
- }).First();
- } while (values.Length==0);
-
- var messageSerializer = container.Resolve<IMessageSerializer>();
- var state = (BaristaState)messageSerializer.Deserialize(new MemoryStream(values[0].Data))[0];
-
- Assert.True(state.DrinkIsReady);
- Assert.False(state.GotPayment);
- Assert.Equal("Coffee", state.Drink);
- }
-
- [Fact]
- public void When_saga_complete_will_remove_from_dht()
- {
- var guid = Guid.NewGuid();
-
- using (var bus = container.Resolve<IStartableServiceBus>())
- {
- bus.Start();
-
- bus.Send(bus.Endpoint, new PrepareDrink
- {
- CorrelationId = guid,
- CustomerName = "ayende",
- DrinkName = "Coffee"
- });
-
- BaristaSaga.FinishedConsumingMessage.WaitOne(TimeSpan.FromSeconds(30), false);
- BaristaSaga.FinishedConsumingMessage.Reset();
-
- using(bus.AddInstanceSubscription(this))
- {
- bus.Send(bus.Endpoint, new PaymentComplete
- {
- CorrelationId = guid,
- });
- BaristaSaga.FinishedConsumingMessage.WaitOne(TimeSpan.FromSeconds(30), false);
- }
- }
-
- var distributedHashTable = container.Resolve<IDistributedHashTableClient>();
-
- Value[] values;
- do
- {
- Thread.Sleep(100);
- values = distributedHashTable.Get(new[]
- {
- new GetRequest
- {
- Key = typeof(BaristaSaga) +"-" +guid
- },
- }).First();
- } while (values.Length != 0);
-
- Assert.Equal(0, values.Length);
- }
-
- [Fact(Skip = "This test needs to be rewritten to make it understandable, I can't figure out what is going on, and I wrote it!")]
- public void When_dht_contains_conflicts_when_saga_is_completed_will_call_saga_again()
- {
- var guid = Guid.NewGuid();
-
- using (var bus = container.Resolve<IStartableServiceBus>())
- {
- bus.Start();
-
- bus.Send(bus.Endpoint, new PrepareDrink
- {
- CorrelationId = guid,
- CustomerName = "ayende",
- DrinkName = "Coffee"
- });
-
- BaristaSaga.FinishedConsumingMessage.WaitOne(TimeSpan.FromSeconds(30), false);
- BaristaSaga.FinishedConsumingMessage.Reset();
-
- BaristaSaga.WaitToCreateConflicts = new ManualResetEvent(false);
-
- using (bus.AddInstanceSubscription(this))
- {
- bus.Send(bus.Endpoint, new PaymentComplete
- {
- CorrelationId = guid,
- });
- BaristaSaga.FinishedConsumingMessage.WaitOne(TimeSpan.FromSeconds(30), false);
-
- BaristaSaga.FinishedConsumingMessage.Reset();
-
- var sagaPersister = container.Resolve<ISagaPersister<BaristaSaga>>();
- var saga = new BaristaSaga(bus)
- {
- Id = guid,
- State = {Drink = "foo"}
- };
- sagaPersister.Save(saga);
-
- BaristaSaga.WaitToCreateConflicts.Set();
- }
- BaristaSaga.FinishedConsumingMessage.WaitOne(TimeSpan.FromSeconds(30), false);
- }
-
-
- Assert.Equal("foo", BaristaSaga.DrinkName);
- }
-
- public void Consume(DrinkReady message)
- {
-
- }
-
- public override void Dispose()
- {
- base.Dispose();
- container.Dispose();
- host.Close();
- }
- }
-}
View
11 Rhino.ServiceBus.Tests/Dht/DrinkReady.cs
@@ -1,11 +0,0 @@
-using System;
-using Rhino.ServiceBus.Sagas;
-
-namespace Rhino.ServiceBus.Tests.Dht
-{
- public class DrinkReady : ISagaMessage
- {
- public Guid CorrelationId { get; set; }
- public string Drink { get; set; }
- }
-}
View
29 Rhino.ServiceBus.Tests/Dht/InvalidBaristaSaga.cs
@@ -1,29 +0,0 @@
-using System;
-using Rhino.ServiceBus.Sagas;
-
-namespace Rhino.ServiceBus.Tests.Dht
-{
- public class InvalidBaristaSaga :
- ISaga<BaristaState>,
- InitiatedBy<PrepareDrink>
- {
- public Guid Id
- {
- get; set;
- }
-
- public bool IsCompleted
- {
- get; set;
- }
-
- public BaristaState State
- {
- get; set;
- }
-
- public void Consume(PrepareDrink message)
- {
- }
- }
-}
View
10 Rhino.ServiceBus.Tests/Dht/PaymentComplete.cs
@@ -1,10 +0,0 @@
-using System;
-using Rhino.ServiceBus.Sagas;
-
-namespace Rhino.ServiceBus.Tests.Dht
-{
- public class PaymentComplete : ISagaMessage
- {
- public Guid CorrelationId { get; set; }
- }
-}
View
18 Rhino.ServiceBus.Tests/Dht/PrepareDrink.cs
@@ -1,18 +0,0 @@
-using System;
-using Rhino.ServiceBus.Sagas;
-
-namespace Rhino.ServiceBus.Tests.Dht
-{
- public class PrepareDrink : ISagaMessage
- {
- public string DrinkName { get; set; }
-
- public string CustomerName { get; set; }
-
- #region ISagaMessage Members
-
- public Guid CorrelationId { get; set; }
-
- #endregion
- }
-}
View
28 Rhino.ServiceBus.Tests/Dht/UsageErrors.cs
@@ -1,28 +0,0 @@
-using Castle.Windsor;
-using Castle.Windsor.Configuration.Interpreters;
-using Rhino.ServiceBus.Exceptions;
-using Rhino.ServiceBus.Impl;
-using Xunit;
-
-namespace Rhino.ServiceBus.Tests.Dht
-{
- using DistributedHashTableIntegration;
-
- public class UsageErrors
- {
- [Fact]
- public void cannot_create_saga_for_dht_without_consuming_merge_saga_state()
- {
- var container = new WindsorContainer(new XmlInterpreter());
- container.Kernel.AddFacility("rhino.esb",
- new RhinoServiceBusFacility()
- );
- container.Kernel.AddFacility("dht.saga", new DhtClientSagaFacility());
- var exception = Assert.Throws<InvalidUsageException>(
- () => container.AddComponent<InvalidBaristaSaga>());
- Assert.Equal(
- "When using DHT for saga state, you must implement either SupportsOptimisticConcurrency or Orchestrates<MergeSagaState>",
- exception.Message);
- }
- }
-}
View
4 Rhino.ServiceBus.Tests/Hosting/Can_host_in_another_app_domain.cs
@@ -1,4 +1,5 @@
using System;
+using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading;
@@ -13,7 +14,8 @@ namespace Rhino.ServiceBus.Tests.Hosting
{
public class Can_host_in_another_app_domain : MsmqTestBase, OccasionalConsumerOf<StringMsg>
{
- readonly RemoteAppDomainHost host = new RemoteAppDomainHost(typeof(TestBootStrapper));
+ readonly RemoteAppDomainHost host = new RemoteAppDomainHost(
+ Path.Combine(Environment.CurrentDirectory, "Rhino.ServiceBus.Tests.dll"), typeof(TestBootStrapper));
private string reply;
private readonly ManualResetEvent resetEvent = new ManualResetEvent(false);
View
59 Rhino.ServiceBus.Tests/Rhino.ServiceBus.Tests.csproj
@@ -31,25 +31,37 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <Reference Include="Castle.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\SharedLibs\Castle\Castle.Core.dll</HintPath>
+ <HintPath>..\SharedLibs\Castle.Core.dll</HintPath>
</Reference>
- <Reference Include="Castle.MicroKernel, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <Reference Include="Castle.MicroKernel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\SharedLibs\Castle\Castle.MicroKernel.dll</HintPath>
+ <HintPath>..\SharedLibs\Castle.MicroKernel.dll</HintPath>
</Reference>
- <Reference Include="Castle.Windsor, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <Reference Include="Castle.Windsor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\SharedLibs\Castle\Castle.Windsor.dll</HintPath>
+ <HintPath>..\SharedLibs\Castle.Windsor.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\SharedLibs\NHibernate\log4net.dll</HintPath>
+ <HintPath>..\SharedLibs\log4net.dll</HintPath>
</Reference>
- <Reference Include="Rhino.Mocks, Version=3.5.0.1337, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
+ <Reference Include="Rhino.DistributedHashTable.Client, Version=1.7.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\build\net-3.5\debug\Rhino.Mocks.dll</HintPath>
+ <HintPath>..\SharedLibs\Rhino.DistributedHashTable.Client.dll</HintPath>
+ </Reference>
+ <Reference Include="Rhino.Mocks, Version=3.6.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\SharedLibs\Rhino.Mocks.dll</HintPath>
+ </Reference>
+ <Reference Include="Rhino.PersistentHashTable, Version=1.7.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\SharedLibs\Rhino.PersistentHashTable.dll</HintPath>
+ </Reference>
+ <Reference Include="Rhino.Queues, Version=1.2.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\SharedLibs\Rhino.Queues.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
@@ -67,11 +79,11 @@
<Reference Include="System.Xml" />
<Reference Include="xunit, Version=1.1.0.1323, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\SharedLibs\xUnit\xunit.dll</HintPath>
+ <HintPath>..\SharedLibs\xunit.dll</HintPath>
</Reference>
<Reference Include="xunit.extensions, Version=1.1.0.1323, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\SharedLibs\xUnit\xunit.extensions.dll</HintPath>
+ <HintPath>..\SharedLibs\xunit.extensions.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -95,15 +107,6 @@
<Compile Include="DataStructures\LRUSetTest.cs" />
<Compile Include="DataStructures\HashtableTest.cs" />
<Compile Include="DefaultReflectionTests.cs" />
- <Compile Include="Dht\BaristaSaga.cs" />
- <Compile Include="Dht\BaristaState.cs" />
- <Compile Include="Dht\BaristaStateMerger.cs" />
- <Compile Include="Dht\DistributedHashTableSagaPersisterTests.cs" />
- <Compile Include="Dht\DrinkReady.cs" />
- <Compile Include="Dht\InvalidBaristaSaga.cs" />
- <Compile Include="Dht\PaymentComplete.cs" />
- <Compile Include="Dht\PrepareDrink.cs" />
- <Compile Include="Dht\UsageErrors.cs" />
<Compile Include="FailureToProcessMessage.cs" />
<Compile Include="CanCreateInstancesOfServiceBusFromContainer.cs" />
<Compile Include="FlatQueuesDelayedMessages.cs" />
@@ -146,22 +149,6 @@
<Compile Include="XmlSerializerTest.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\pht\Rhino.PersistentHashTable\Rhino.PersistentHashTable.csproj">
- <Project>{F30B2D63-CED5-4C8A-908F-0B5503D984A9}</Project>
- <Name>Rhino.PersistentHashTable</Name>
- </ProjectReference>
- <ProjectReference Include="..\..\queues\Rhino.Queues\Rhino.Queues.csproj">
- <Project>{398BF580-41F5-418E-A017-19D19B289A97}</Project>
- <Name>Rhino.Queues</Name>
- </ProjectReference>
- <ProjectReference Include="..\Rhino.DistributedHashTable\Rhino.DistributedHashTable.csproj">
- <Project>{63530BA6-3424-49D9-B32C-A35A603817CE}</Project>
- <Name>Rhino.DistributedHashTable</Name>
- </ProjectReference>
- <ProjectReference Include="..\Rhino.ServiceBus.DistributedHashTableIntegration\Rhino.ServiceBus.DistributedHashTableIntegration.csproj">
- <Project>{CBBB042F-D5E4-4BCD-AE95-D6D886DA8222}</Project>
- <Name>Rhino.ServiceBus.DistributedHashTableIntegration</Name>
- </ProjectReference>
<ProjectReference Include="..\Rhino.ServiceBus\Rhino.ServiceBus.csproj">
<Project>{1B21C8A5-5E0E-412B-A7F4-9F28B4427F21}</Project>
<Name>Rhino.ServiceBus</Name>
View
48 Rhino.ServiceBus.sln
@@ -13,22 +13,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rhino.ServiceBus.Host", "Rh
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Starbucks.Tests", "Samples\Starbucks.Tests\Starbucks.Tests.csproj", "{EBCAD5F6-F6A4-47C8-B8B5-F92E26CBACDA}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rhino.DistributedHashTable", "Rhino.DistributedHashTable\Rhino.DistributedHashTable.csproj", "{63530BA6-3424-49D9-B32C-A35A603817CE}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rhino.DistributedHashTable.Tests", "Rhino.DistributedHashTable.Tests\Rhino.DistributedHashTable.Tests.csproj", "{A9B450CA-22D0-4234-BA46-62A39FC554F4}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rhino.ServiceBus.DistributedHashTableIntegration", "Rhino.ServiceBus.DistributedHashTableIntegration\Rhino.ServiceBus.DistributedHashTableIntegration.csproj", "{CBBB042F-D5E4-4BCD-AE95-D6D886DA8222}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rhino.PersistentHashTable", "..\pht\Rhino.PersistentHashTable\Rhino.PersistentHashTable.csproj", "{F30B2D63-CED5-4C8A-908F-0B5503D984A9}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rhino.PersistentHashTable.Tests", "..\pht\Rhino.PersistentHashTable.Tests\Rhino.PersistentHashTable.Tests.csproj", "{3BC9E44C-6E3B-4E3C-B7E1-4850C3DB5251}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rhino.Queues", "..\queues\Rhino.Queues\Rhino.Queues.csproj", "{398BF580-41F5-418E-A017-19D19B289A97}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rhino.Queues.Tests", "..\queues\Rhino.Queues.Tests\Rhino.Queues.Tests.csproj", "{98D394CA-9FEF-49AD-8DAB-FE039152E001}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rhino.ServiceBus.NHibernate", "Rhino.ServiceBus.NHibernate\Rhino.ServiceBus.NHibernate.csproj", "{B60DF631-07EE-4E5E-BA81-638AF759D1A0}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -55,38 +39,6 @@ Global
{EBCAD5F6-F6A4-47C8-B8B5-F92E26CBACDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EBCAD5F6-F6A4-47C8-B8B5-F92E26CBACDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EBCAD5F6-F6A4-47C8-B8B5-F92E26CBACDA}.Release|Any CPU.Build.0 = Release|Any CPU
- {63530BA6-3424-49D9-B32C-A35A603817CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {63530BA6-3424-49D9-B32C-A35A603817CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {63530BA6-3424-49D9-B32C-A35A603817CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {63530BA6-3424-49D9-B32C-A35A603817CE}.Release|Any CPU.Build.0 = Release|Any CPU
- {A9B450CA-22D0-4234-BA46-62A39FC554F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A9B450CA-22D0-4234-BA46-62A39FC554F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A9B450CA-22D0-4234-BA46-62A39FC554F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A9B450CA-22D0-4234-BA46-62A39FC554F4}.Release|Any CPU.Build.0 = Release|Any CPU
- {CBBB042F-D5E4-4BCD-AE95-D6D886DA8222}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CBBB042F-D5E4-4BCD-AE95-D6D886DA8222}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CBBB042F-D5E4-4BCD-AE95-D6D886DA8222}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CBBB042F-D5E4-4BCD-AE95-D6D886DA8222}.Release|Any CPU.Build.0 = Release|Any CPU
- {F30B2D63-CED5-4C8A-908F-0B5503D984A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F30B2D63-CED5-4C8A-908F-0B5503D984A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F30B2D63-CED5-4C8A-908F-0B5503D984A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F30B2D63-CED5-4C8A-908F-0B5503D984A9}.Release|Any CPU.Build.0 = Release|Any CPU
- {3BC9E44C-6E3B-4E3C-B7E1-4850C3DB5251}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3BC9E44C-6E3B-4E3C-B7E1-4850C3DB5251}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3BC9E44C-6E3B-4E3C-B7E1-4850C3DB5251}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3BC9E44C-6E3B-4E3C-B7E1-4850C3DB5251}.Release|Any CPU.Build.0 = Release|Any CPU
- {398BF580-41F5-418E-A017-19D19B289A97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {398BF580-41F5-418E-A017-19D19B289A97}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {398BF580-41F5-418E-A017-19D19B289A97}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {398BF580-41F5-418E-A017-19D19B289A97}.Release|Any CPU.Build.0 = Release|Any CPU
- {98D394CA-9FEF-49AD-8DAB-FE039152E001}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {98D394CA-9FEF-49AD-8DAB-FE039152E001}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {98D394CA-9FEF-49AD-8DAB-FE039152E001}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {98D394CA-9FEF-49AD-8DAB-FE039152E001}.Release|Any CPU.Build.0 = Release|Any CPU
- {B60DF631-07EE-4E5E-BA81-638AF759D1A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B60DF631-07EE-4E5E-BA81-638AF759D1A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B60DF631-07EE-4E5E-BA81-638AF759D1A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B60DF631-07EE-4E5E-BA81-638AF759D1A0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
9 Rhino.ServiceBus/Hosting/RemoteAppDomainHost.cs
@@ -21,12 +21,17 @@ public RemoteAppDomainHost(Assembly assembly, string configuration)
{
}
- public RemoteAppDomainHost(Type boosterType)
- : this(boosterType.Assembly.Location, null)
+ public RemoteAppDomainHost(string assemblyPath, Type boosterType)
+ : this(assemblyPath, (string)null)
{
this.boosterType = boosterType.FullName;
}
+ public RemoteAppDomainHost(Type boosterType)
+ : this(boosterType.Assembly.Location, boosterType)
+ {
+ }
+
public RemoteAppDomainHost(string assemblyPath, string configuration)
{
configurationFile = configuration;
View
4 Rhino.ServiceBus/Hosting/RemoteAppDomainLoadBalancerHost.cs
@@ -6,10 +6,6 @@ namespace Rhino.ServiceBus.Hosting
{
public class RemoteAppDomainLoadBalancerHost : RemoteAppDomainHost
{
- public RemoteAppDomainLoadBalancerHost(Type boosterType) : base(boosterType)
- {
- }
-
public RemoteAppDomainLoadBalancerHost(string assemblyPath, string configuration)
: base(assemblyPath, configuration)
{
View
72 Rhino.ServiceBus/Impl/DefaultReflection.cs
@@ -323,41 +323,43 @@ public string GetNamespaceForXml(Type type)
return typeName.Substring(0,typeName.Length-1);
}
- public string GetAssemblyQualifiedNameWithoutVersion(Type type)
- {
- string value;
- if (typeToWellKnownTypeName.TryGetValue(type, out value))
- return value;
-
- Assembly assembly = type.Assembly;
- string fullName = assembly.FullName ?? assembly.GetName().Name;
- if (type.IsGenericType)
- {
- var builder = new StringBuilder();
- builder.Append(type.Namespace).Append(".")
- .Append(type.Name).Append("[")
- .Append(String.Join(",",
- type.GetGenericArguments()
- .Select(t => "[" + GetAssemblyQualifiedNameWithoutVersion(t) + "]")
- .ToArray()))
- .Append("], ");
- if (assembly.GlobalAssemblyCache)
- {
- builder.Append(fullName);
- }
- else
- {
- builder.Append(fullName.Split(',')[0]);
- }
- return builder.ToString();
- }
-
- if (assembly.GlobalAssemblyCache == false)
- {
- return type.FullName + ", " + fullName.Split(',')[0];
- }
- return type.AssemblyQualifiedName;
- }
+
+ public string GetAssemblyQualifiedNameWithoutVersion(Type type)
+ {
+ string value;
+ if (typeToWellKnownTypeName.TryGetValue(type, out value))
+ return value;
+
+ Assembly assembly = type.Assembly;
+ string fullName = assembly.FullName ?? assembly.GetName().Name;
+ if (type.IsGenericType)
+ {
+ var builder = new StringBuilder();
+ int startOfGenericName = type.FullName.IndexOf('[');
+ builder.Append(type.FullName.Substring(0, startOfGenericName))
+ .Append("[")
+ .Append(String.Join(",",
+ type.GetGenericArguments()
+ .Select(t => "[" + GetAssemblyQualifiedNameWithoutVersion(t) + "]")
+ .ToArray()))
+ .Append("], ");
+ if (assembly.GlobalAssemblyCache)
+ {
+ builder.Append(fullName);
+ }
+ else
+ {
+ builder.Append(fullName.Split(',')[0]);
+ }
+ return builder.ToString();
+ }
+
+ if (assembly.GlobalAssemblyCache == false)
+ {
+ return type.FullName + ", " + fullName.Split(',')[0];
+ }
+ return type.AssemblyQualifiedName;
+ }
public IEnumerable<string> GetProperties(object value)
{
View
36 Rhino.ServiceBus/Rhino.ServiceBus.csproj
@@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.21022</ProductVersion>
+ <ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1B21C8A5-5E0E-412B-A7F4-9F28B4427F21}</ProjectGuid>
<OutputType>Library</OutputType>
@@ -32,21 +32,29 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <Reference Include="Castle.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\SharedLibs\Castle\Castle.Core.dll</HintPath>
+ <HintPath>..\SharedLibs\Castle.Core.dll</HintPath>
</Reference>
- <Reference Include="Castle.MicroKernel, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <Reference Include="Castle.MicroKernel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\SharedLibs\Castle\Castle.MicroKernel.dll</HintPath>
+ <HintPath>..\SharedLibs\Castle.MicroKernel.dll</HintPath>
</Reference>
- <Reference Include="Castle.Windsor, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <Reference Include="Castle.Windsor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\SharedLibs\Castle\Castle.Windsor.dll</HintPath>
+ <HintPath>..\SharedLibs\Castle.Windsor.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\SharedLibs\NHibernate\log4net.dll</HintPath>
+ <HintPath>..\SharedLibs\log4net.dll</HintPath>
+ </Reference>
+ <Reference Include="Rhino.PersistentHashTable, Version=1.7.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\SharedLibs\Rhino.PersistentHashTable.dll</HintPath>
+ </Reference>
+ <Reference Include="Rhino.Queues, Version=1.2.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\SharedLibs\Rhino.Queues.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
@@ -204,16 +212,6 @@
<Compile Include="Util\UriExtensions.cs" />
<None Include="PublicApi.cd" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\pht\Rhino.PersistentHashTable\Rhino.PersistentHashTable.csproj">
- <Project>{F30B2D63-CED5-4C8A-908F-0B5503D984A9}</Project>
- <Name>Rhino.PersistentHashTable</Name>
- </ProjectReference>
- <ProjectReference Include="..\..\queues\Rhino.Queues\Rhino.Queues.csproj">
- <Project>{398BF580-41F5-418E-A017-19D19B289A97}</Project>
- <Name>Rhino.Queues</Name>
- </ProjectReference>
- </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -222,4 +220,4 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project>
View
12 Rhino.ServiceBus/RhinoQueues/PhtSubscriptionStorage.cs
@@ -16,7 +16,7 @@ namespace Rhino.ServiceBus.RhinoQueues
{
public class PhtSubscriptionStorage : ISubscriptionStorage, IDisposable, IMessageModule
{
- private const string subscriptionsKey = "subscriptions";
+ private const string SubscriptionsKey = "subscriptions";
private readonly Hashtable<string, List<WeakReference>> localInstanceSubscriptions =
new Hashtable<string, List<WeakReference>>();
@@ -82,7 +82,7 @@ public void Initialize()
{
var items = actions.GetItems(new GetItemsRequest
{
- Key = subscriptionsKey
+ Key = SubscriptionsKey
});
foreach (var item in items)
{
@@ -287,7 +287,7 @@ private void RemoveSubscriptionMessageFromPht(string type, Uri uri)
actions.RemoveItem(new RemoveItemRequest
{
Id = msgId,
- Key = subscriptionsKey
+ Key = SubscriptionsKey
});
}
@@ -332,7 +332,7 @@ public bool ConsumeRemoveInstanceSubscription(RemoveInstanceSubscription subscri
actions.RemoveItem(new RemoveItemRequest
{
Id = msgId,
- Key = subscriptionsKey
+ Key = SubscriptionsKey
});
actions.Commit();
@@ -351,7 +351,7 @@ public bool ConsumeRemoveInstanceSubscription(RemoveInstanceSubscription subscri
messageSerializer.Serialize(new[] {subscription}, message);
var itemId = actions.AddItem(new AddItemRequest
{
- Key = subscriptionsKey,
+ Key = SubscriptionsKey,
Data = message.ToArray()
});
@@ -388,7 +388,7 @@ public bool ConsumeAddSubscription(AddSubscription addSubscription)
messageSerializer.Serialize(new[] {addSubscription}, stream);
itemId = actions.AddItem(new AddItemRequest
{
- Key = subscriptionsKey,
+ Key = SubscriptionsKey,
Data = stream.ToArray()
});
View
1  Rhino.ServiceBus/RhinoQueues/RhinoQueuesTransport.cs
@@ -85,6 +85,7 @@ public void Dispose()
}
}
+ [CLSCompliant(false)]
public IQueue Queue
{
get { return queue; }
View
2  Rhino.ServiceBus/RhinoQueues/TimeoutAction.cs
@@ -20,6 +20,7 @@ public class TimeoutAction : IDisposable
private readonly OrderedList<DateTime, MessageId> timeoutMessageIds =
new OrderedList<DateTime, MessageId>();
+ [CLSCompliant(false)]
public TimeoutAction(IQueue queue)
{
this.queue = queue;
@@ -101,6 +102,7 @@ public void Dispose()
timeoutTimer.Dispose();
}
+ [CLSCompliant(false)]
public void Register(Message message)
{
timeoutMessageIds.Write(writer =>
View
18 Samples/Starbucks.Tests/Starbucks.Tests.csproj
@@ -31,17 +31,21 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <Reference Include="Castle.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\SharedLibs\Castle\Castle.Core.dll</HintPath>
+ <HintPath>..\..\SharedLibs\Castle.Core.dll</HintPath>
</Reference>
- <Reference Include="Castle.MicroKernel, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <Reference Include="Castle.DynamicProxy2, Version=2.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\SharedLibs\Castle\Castle.MicroKernel.dll</HintPath>
+ <HintPath>..\..\SharedLibs\Castle.DynamicProxy2.dll</HintPath>
</Reference>
- <Reference Include="Castle.Windsor, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <Reference Include="Castle.MicroKernel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\SharedLibs\Castle\Castle.Windsor.dll</HintPath>
+ <HintPath>..\..\SharedLibs\Castle.MicroKernel.dll</HintPath>
+ </Reference>
+ <Reference Include="Castle.Windsor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\SharedLibs\Castle.Windsor.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
@@ -57,7 +61,7 @@
<Reference Include="System.Xml" />
<Reference Include="xunit, Version=1.1.0.1323, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\SharedLibs\xUnit\xunit.dll</HintPath>
+ <HintPath>..\..\SharedLibs\xunit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
View
26 Samples/Starbucks/Starbucks.csproj
@@ -31,21 +31,29 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <Reference Include="Castle.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\SharedLibs\Castle\Castle.Core.dll</HintPath>
+ <HintPath>..\..\SharedLibs\Castle.Core.dll</HintPath>
</Reference>
- <Reference Include="Castle.MicroKernel, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <Reference Include="Castle.DynamicProxy2, Version=2.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\SharedLibs\Castle\Castle.MicroKernel.dll</HintPath>
+ <HintPath>..\..\SharedLibs\Castle.DynamicProxy2.dll</HintPath>
</Reference>
- <Reference Include="Castle.Windsor, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <Reference Include="Castle.MicroKernel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\SharedLibs\Castle\Castle.Windsor.dll</HintPath>
+ <HintPath>..\..\SharedLibs\Castle.MicroKernel.dll</HintPath>
+ </Reference>
+ <Reference Include="Castle.Windsor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\SharedLibs\Castle.Windsor.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\SharedLibs\NHibernate\log4net.dll</HintPath>
+ <HintPath>..\..\SharedLibs\log4net.dll</HintPath>
+ </Reference>
+ <Reference Include="Rhino.Queues, Version=1.2.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\SharedLibs\Rhino.Queues.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
@@ -82,10 +90,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\..\queues\Rhino.Queues\Rhino.Queues.csproj">
- <Project>{398BF580-41F5-418E-A017-19D19B289A97}</Project>
- <Name>Rhino.Queues</Name>
- </ProjectReference>
<ProjectReference Include="..\..\Rhino.ServiceBus\Rhino.ServiceBus.csproj">
<Project>{1B21C8A5-5E0E-412B-A7F4-9F28B4427F21}</Project>
<Name>Rhino.ServiceBus</Name>
View
BIN  SharedLibs/Castle.Core.dll
Binary file not shown
View
3,197 SharedLibs/Castle.Core.xml
3,197 additions, 0 deletions not shown
View
BIN  SharedLibs/Castle.DynamicProxy2.dll
Binary file not shown
View
1,249 SharedLibs/Castle.DynamicProxy2.xml
1,249 additions, 0 deletions not shown
View
BIN  SharedLibs/Castle.MicroKernel.dll
Binary file not shown
View
5,484 SharedLibs/Castle.MicroKernel.xml
5,484 additions, 0 deletions not shown
View
BIN  SharedLibs/Castle.Windsor.dll
Binary file not shown
View
1,571 SharedLibs/Castle.Windsor.xml
@@ -0,0 +1,1571 @@
+<?xml version="1.0"?>
+<doc>
+ <assembly>
+ <name>Castle.Windsor</name>
+ </assembly>
+ <members>
+ <member name="T:Castle.Windsor.Adapters.ComponentModel.ContainerAdapter">
+ <summary>
+ Implementation of <see cref="T:Castle.Windsor.Adapters.ComponentModel.IContainerAdapter"/> that assumes ownership of the
+ wrapped <see cref="T:Castle.Windsor.IWindsorContainer"/>. If this adapter is disposed, the underlying
+ <see cref="T:Castle.Windsor.IWindsorContainer"/> is diposed as well.
+ </summary>
+ </member>
+ <member name="T:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper">
+ <summary>
+ Implementation of <see cref="T:Castle.Windsor.Adapters.ComponentModel.IContainerAdapter"/> that does not assume ownership of the
+ wrapped <see cref="T:Castle.Windsor.IWindsorContainer"/>.
+ </summary>
+ </member>
+ <member name="T:Castle.Windsor.Adapters.ComponentModel.IContainerAdapter">
+ <summary>
+ Integrates the <see cref="T:Castle.Windsor.WindsorContainer"/> to the System.ComponentModel
+ and System.ComponentMode.Design infrastructure.
+ </summary>
+ <seealso cref="T:System.ComponentModel.IComponent"/>
+ <seealso cref="T:System.ComponentModel.IContainer"/>
+ <seealso cref="T:System.ComponentModel.Design.IServiceContainer"/>
+ </member>
+ <member name="T:Castle.Windsor.IContainerAccessor">
+ <summary>
+ This interface should be implemented by classes
+ that are available in a bigger context, exposing
+ the container to different areas in the same application.
+ <para>
+ For example, in Web application, the (global) HttpApplication
+ subclasses should implement this interface to expose
+ the configured container
+ </para>
+ </summary>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.#ctor(Castle.Windsor.IWindsorContainer)">
+ <summary>
+ Constructs an initial ContainerWrapper.
+ </summary>
+ <param name="container">The <see cref="T:Castle.Windsor.IWindsorContainer"/> to adapt.</param>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.#ctor(Castle.Windsor.IWindsorContainer,System.IServiceProvider)">
+ <summary>
+ Constructs an initial ContainerWrapper.
+ </summary>
+ <param name="container">The <see cref="T:Castle.Windsor.IWindsorContainer"/> to adapt.</param>
+ <param name="parentProvider">The parent <see cref="T:System.IServiceProvider"/>.</param>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.Add(System.ComponentModel.IComponent)">
+ <summary>
+ Adds the specified <see cref="T:System.ComponentModel.IComponent"/> to the <see cref="T:System.ComponentModel.IContainer"/> at the end of the list.
+ </summary>
+ <param name="component">The <see cref="T:System.ComponentModel.IComponent"/> to add.</param>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.Add(System.ComponentModel.IComponent,System.String)">
+ <summary>
+ Adds the specified <see cref="T:System.ComponentModel.IComponent"/> to the <see cref="T:System.ComponentModel.IContainer"/> at the end of the list,
+ and assigns a name to the component.
+ </summary>
+ <param name="component">The <see cref="T:System.ComponentModel.IComponent"/> to add.</param>
+ <param name="name">The unique, case-insensitive name to assign to the component, or null.</param>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.Remove(System.ComponentModel.IComponent)">
+ <summary>
+ Removes a component from the <see cref="T:System.ComponentModel.IContainer"/>.
+ </summary>
+ <param name="component">The <see cref="T:System.ComponentModel.IComponent"/> to remove</param>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.GetService(System.Type)">
+ <summary>
+ Gets the service object of the specified type.
+ </summary>
+ <param name="serviceType">The type of service.</param>
+ <returns>An object inplementing service, or null.</returns>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.AddService(System.Type,System.Object)">
+ <summary>
+ Adds the specified service to the service container.
+ </summary>
+ <param name="serviceType">The type of service to add.</param>
+ <param name="serviceInstance">The instance of the service to add.</param>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.AddService(System.Type,System.ComponentModel.Design.ServiceCreatorCallback)">
+ <summary>
+ Adds the specified service to the service container.
+ </summary>
+ <param name="serviceType">The type of service to add.</param>
+ <param name="callback">A callback object that is used to create the service.</param>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.AddService(System.Type,System.Object,System.Boolean)">
+ <summary>
+ Adds the specified service to the service container, and optionally
+ promotes the service to any parent service containers.
+ </summary>
+ <param name="serviceType">The type of service to add.</param>
+ <param name="serviceInstance">The instance of the service to add.</param>
+ <param name="promote">true to promote this request to any parent service containers.</param>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.AddService(System.Type,System.ComponentModel.Design.ServiceCreatorCallback,System.Boolean)">
+ <summary>
+ Adds the specified service to the service container, and optionally
+ promotes the service to parent service containers.
+ </summary>
+ <param name="serviceType">The type of service to add.</param>
+ <param name="callback">A callback object that is used to create the service.</param>
+ <param name="promote">true to promote this request to any parent service containers.</param>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.RemoveService(System.Type)">
+ <summary>
+ Removes the specified service type from the service container.
+ </summary>
+ <param name="serviceType">The type of service to remove.</param>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.RemoveService(System.Type,System.Boolean)">
+ <summary>
+ Removes the specified service type from the service container,
+ and optionally promotes the service to parent service containers.
+ </summary>
+ <param name="serviceType">The type of service to remove.</param>
+ <param name="promote">true to promote this request to any parent service containers.</param>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.IsIntrinsicService(System.Type)">
+ <summary>
+ Determins if the service type represents an intrinsic service.
+ </summary>
+ <param name="serviceType">The type of service to remove.</param>
+ <returns>true if the service type is an intrinsic service.</returns>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.HasService(System.Type)">
+ <summary>
+ Determins if the specified service type exists in the service container.
+ </summary>
+ <param name="serviceType">The type of service to remove.</param>
+ <returns>true if the service type exists.</returns>
+ </member>
+ <member name="M:Castle.Windsor.Adapters.ComponentModel.ContainerWrapper.Dispose">
+ <summary>
+ Releases the resources used by the component.
+ </summary