예제 #1
0
        private static IStoreEvents BuildEventStore(NanoContainer context)
        {
            var concurrentHook = new OptimisticPipelineHook();
            var dispatcherHook = new DispatchPipelineHook(context.Resolve <IDispatchCommits>());

            var pipelineHooks = context.Resolve <ICollection <IPipelineHook> >() ?? new IPipelineHook[0];

            pipelineHooks = new IPipelineHook[] { concurrentHook, dispatcherHook }.Concat(pipelineHooks).ToArray();

            return(new OptimisticEventStore(context.Resolve <IPersistStreams>(), pipelineHooks));
        }
예제 #2
0
        private static IStoreEvents BuildEventStore(NanoContainer context)
        {
            var scopeOption    = context.Resolve <TransactionScopeOption>();
            var concurrentHook = scopeOption == TransactionScopeOption.Suppress ? new OptimisticPipelineHook() : null;
            var dispatcherHook = new DispatchPipelineHook(context.Resolve <IDispatchCommits>());

            var pipelineHooks = context.Resolve <ICollection <IPipelineHook> >() ?? new IPipelineHook[0];

            pipelineHooks = new IPipelineHook[] { concurrentHook, dispatcherHook }
            .Concat(pipelineHooks)
            .Where(x => x != null)
            .ToArray();

            return(new OptimisticEventStore(context.Resolve <IPersistStreams>(), pipelineHooks));
        }
예제 #3
0
        private static IStoreEvents BuildEventStore(NanoContainer context)
        {
            var scopeOption = context.Resolve <TransactionScopeOption>();
            var concurrency = scopeOption == TransactionScopeOption.Suppress ? new OptimisticPipelineHook() : null;
            var scheduler   = new DispatchSchedulerPipelineHook(context.Resolve <IScheduleDispatches>());
            var upconverter = context.Resolve <EventUpconverterPipelineHook>();

            var hooks = context.Resolve <ICollection <IPipelineHook> >() ?? new IPipelineHook[0];

            hooks = new IPipelineHook[] { concurrency, scheduler, upconverter }
            .Concat(hooks)
            .Where(x => x != null)
            .ToArray();

            return(new OptimisticEventStore(context.Resolve <IPersistStreams>(), hooks));
        }
예제 #4
0
        private IDocumentSerializer ResolveSerializer(NanoContainer container)
        {
            var registered = container.Resolve <ISerialize>();

            if (registered == null)
            {
                return(this.serializer);
            }

            Logger.Debug("Wrapping registered serializer of type '{0}' inside of a ByteStreamDocumentSerializer", registered.GetType());
            return(new ByteStreamDocumentSerializer(registered));
        }