/** * 使用指定的 聚合工厂 和 聚合 事件仓储 初始化 * * @param aggregateFactory The factory for new aggregate instances * @param AggregateEventStore The event store that holds the event streams for this repository */ public EventSourcingRepository( final AggregateFactory<T> aggregateFactory, AggregateEventStore AggregateEventStore) { super(aggregateFactory.getAggregateType()); Assert.notNull(AggregateEventStore, "AggregateEventStore may not be null"); this.aggregateFactory = aggregateFactory; this.AggregateEventStore = AggregateEventStore; }
/** * 使用指定的 锁 机制 初始化 * * @param aggregateFactory The factory for new aggregate instances * @param AggregateEventStore The event store that holds the event streams for this repository * @param lockManager the locking strategy to apply to this repository */ public EventSourcingRepository( AggregateFactory<T> aggregateFactory, AggregateEventStore AggregateEventStore, LockManager lockManager) { super(aggregateFactory.getAggregateType(), lockManager); Assert.notNull(AggregateEventStore, "AggregateEventStore may not be null"); this.AggregateEventStore = AggregateEventStore; this.aggregateFactory = aggregateFactory; }