Ejemplo n.º 1
0
        public TransformationHandler(
            long journaledSequence,
            IRingBuffer <JournalItem> journalRing,
            IDeliveryHandler deliveryHandler,
            ISystemSnapshotTracker snapshot)
        {
            if (journaledSequence < 0)
            {
                throw new ArgumentOutOfRangeException("journaledSequence");
            }

            if (journalRing == null)
            {
                throw new ArgumentNullException("journalRing");
            }

            if (deliveryHandler == null)
            {
                throw new ArgumentNullException("deliveryHandler");
            }

            if (snapshot == null)
            {
                throw new ArgumentNullException("snapshot");
            }

            this.currentSequnce  = journaledSequence;
            this.journalRing     = journalRing;
            this.deliveryHandler = deliveryHandler;
            this.snapshot        = snapshot;
            this.canHandle       = true;
        }
Ejemplo n.º 2
0
        private TransformationHandler CreateTransformationHandler(IRepository repository, long sequence, ISystemSnapshotTracker tracker = null)
        {
            tracker = tracker ?? new NullSystemSnapshotTracker();
            var watcher = TimeoutHydratable.Load(repository);

            var transformer = (ITransformer) new Transformer(repository, this.snapshotRing, watcher);

            transformer = new CommandFilterTransformer(transformer);
            var handler = new ReflectionDeliveryHandler(transformer);

            return(new TransformationHandler(sequence, this.journalRing, handler, tracker));
        }