Ejemplo n.º 1
0
 /**
  * 使用指定的 仓储和 工厂 和类型
  *
  * @param sagaRepository The repository providing the saga instances.
  * @param sagaFactory The factory providing new saga instances
  * @param sagaTypes The types of Saga supported by this Saga Manager
  */
 public AbstractSagaManager(
     SagaRepository sagaRepository, SagaFactory sagaFactory, Class<? extends Saga>... sagaTypes) {
   Assert.notNull(sagaRepository, "sagaRepository may not be null");
   Assert.notNull(sagaFactory, "sagaFactory may not be null");
   this.sagaRepository = sagaRepository;
   this.sagaFactory = sagaFactory;
   this.sagaTypes = sagaTypes;
 }
Ejemplo n.º 2
0
 /**
  * 使用指定的 聚合工厂 和 聚合 事件仓储 初始化
  *
  * @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;
 }
Ejemplo n.º 3
0
 /**
  * 使用指定的 锁 机制 初始化
  *
  * @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;
 }
Ejemplo n.º 4
0
 /**
  * 根据给定的 converFactory 和 upcasters list 初始化
  *
  * @param converterFactory The factory providing the converters to convert between content types
  * @param upcasters The upcasters to form this chain
  */
 protected AbstractUpcasterChain(ConverterFactory converterFactory, List<Upcaster<?>> upcasters) {
   Assert.notNull(converterFactory, "converterFactory may not be null");
   this.upcasters = upcasters;
   this.converterFactory = converterFactory;
 }