Skip to content

Commit 7cf64f7

Browse files
committed
- v10.0.0
1 parent 7225a68 commit 7cf64f7

2 files changed

Lines changed: 4 additions & 89 deletions

File tree

Lines changed: 1 addition & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using Shuttle.Core.Container;
4-
using Shuttle.Core.Contract;
1+
using Shuttle.Core.Contract;
52
using Shuttle.Core.Pipelines;
6-
using Shuttle.Core.PipelineTransaction;
7-
using Shuttle.Core.Reflection;
8-
using Shuttle.Core.Serialization;
93
using Shuttle.Core.Threading;
10-
using Shuttle.Core.Transactions;
114

125
namespace Shuttle.Recall
136
{
@@ -53,83 +46,5 @@ public void Execute(IThreadState state)
5346

5447
_pipelineFactory.ReleasePipeline(pipeline);
5548
}
56-
57-
public static void Register(IComponentRegistry registry, IEventStoreConfiguration configuration)
58-
{
59-
Guard.AgainstNull(registry, nameof(registry));
60-
Guard.AgainstNull(configuration, nameof(configuration));
61-
62-
registry.AttemptRegisterInstance(configuration);
63-
64-
registry.RegistryBoostrap();
65-
66-
registry.AttemptRegister<IEventMethodInvokerConfiguration, EventMethodInvokerConfiguration>();
67-
registry.AttemptRegister<IEventMethodInvoker, DefaultEventMethodInvoker>();
68-
registry.AttemptRegister<ISerializer, DefaultSerializer>();
69-
registry.AttemptRegister<IProjectionSequenceNumberTracker, ProjectionSequenceNumberTracker>();
70-
registry.AttemptRegister<IPrimitiveEventQueue, PrimitiveEventQueue>();
71-
registry.AttemptRegister<IConcurrenyExceptionSpecification, DefaultConcurrenyExceptionSpecification>();
72-
73-
registry.AttemptRegister<TransactionScopeObserver, TransactionScopeObserver>();
74-
75-
if (!registry.IsRegistered<ITransactionScopeFactory>())
76-
{
77-
var transactionScopeConfiguration =
78-
configuration.TransactionScope ?? new TransactionScopeConfiguration();
79-
80-
registry.AttemptRegisterInstance<ITransactionScopeFactory>(
81-
new DefaultTransactionScopeFactory(transactionScopeConfiguration.Enabled,
82-
transactionScopeConfiguration.IsolationLevel,
83-
TimeSpan.FromSeconds(transactionScopeConfiguration.TimeoutSeconds)));
84-
}
85-
86-
registry.AttemptRegister<IPipelineFactory, DefaultPipelineFactory>();
87-
88-
var reflectionService = new ReflectionService();
89-
90-
foreach (var type in reflectionService.GetTypesAssignableTo<IPipeline>(typeof(EventProcessor).Assembly))
91-
{
92-
if (type.IsInterface || type.IsAbstract || registry.IsRegistered(type))
93-
{
94-
continue;
95-
}
96-
97-
registry.Register(type, type, Lifestyle.Transient);
98-
}
99-
100-
var observers = new List<Type>();
101-
102-
foreach (var type in reflectionService.GetTypesAssignableTo<IPipelineObserver>(typeof(EventProcessor).Assembly))
103-
{
104-
if (type.IsInterface || type.IsAbstract)
105-
{
106-
continue;
107-
}
108-
109-
var interfaceType = type.InterfaceMatching($"I{type.Name}");
110-
111-
if (interfaceType != null)
112-
{
113-
if (registry.IsRegistered(type))
114-
{
115-
continue;
116-
}
117-
118-
registry.Register(interfaceType, type, Lifestyle.Singleton);
119-
}
120-
else
121-
{
122-
throw new ApplicationException(string.Format(Resources.ObserverInterfaceMissingException, type.Name));
123-
}
124-
125-
observers.Add(type);
126-
}
127-
128-
registry.RegisterCollection(typeof(IPipelineObserver), observers, Lifestyle.Singleton);
129-
130-
registry.AttemptRegister<IEventStore, EventStore>();
131-
registry.AttemptRegister<IEventProcessor, EventProcessor>();
132-
}
133-
13449
}
13550
}

Shuttle.Recall/EventStore.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@ public static void Register(IComponentRegistry registry, IEventStoreConfiguratio
128128
registry.AttemptRegister<IEventMethodInvokerConfiguration, EventMethodInvokerConfiguration>();
129129
registry.AttemptRegister<IEventMethodInvoker, DefaultEventMethodInvoker>();
130130
registry.AttemptRegister<ISerializer, DefaultSerializer>();
131+
registry.AttemptRegister<IProjectionSequenceNumberTracker, ProjectionSequenceNumberTracker>();
132+
registry.AttemptRegister<IPrimitiveEventQueue, PrimitiveEventQueue>();
131133
registry.AttemptRegister<IConcurrenyExceptionSpecification, DefaultConcurrenyExceptionSpecification>();
132134

133-
registry.AttemptRegister<TransactionScopeObserver, TransactionScopeObserver>();
135+
registry.AttemptRegister<ITransactionScopeObserver, TransactionScopeObserver>();
134136

135137
if (!registry.IsRegistered<ITransactionScopeFactory>())
136138
{
@@ -185,8 +187,6 @@ public static void Register(IComponentRegistry registry, IEventStoreConfiguratio
185187
observers.Add(type);
186188
}
187189

188-
registry.RegisterCollection(typeof(IPipelineObserver), observers, Lifestyle.Singleton);
189-
190190
registry.AttemptRegister<IEventStore, EventStore>();
191191
registry.AttemptRegister<IEventProcessor, EventProcessor>();
192192
}

0 commit comments

Comments
 (0)