Package org.axonframework.saga.repository.inmemory

Examples of org.axonframework.saga.repository.inmemory.InMemorySagaRepository


        // The Saga will schedule some deadlines in our sample
        final ScheduledExecutorService executorService = newSingleThreadScheduledExecutor();
        EventScheduler eventScheduler = new SimpleEventScheduler(executorService, eventBus);

        // we need to store a Saga somewhere. Let's do that in memory for now
        InMemorySagaRepository sagaRepository = new InMemorySagaRepository();

        // we want to inject resources in our Saga, so we need to tweak the GenericSagaFactory
        GenericSagaFactory sagaFactory = new GenericSagaFactory();
        // this will allow the eventScheduler and commandGateway to be injected in our Saga
        sagaFactory.setResourceInjector(new SimpleResourceInjector(eventScheduler, commandGateway));
View Full Code Here


    @Before
    public void setUp() throws Exception {
        commandBus = new RecordingCommandBus();
        eventBus = new SimpleEventBus();
        eventScheduler = new StubEventScheduler();
        sagaRepository = new InMemorySagaRepository();
        testSubject = new FixtureExecutionResultImpl(sagaRepository, eventScheduler, eventBus,
                                                     commandBus, StubSaga.class);
        testSubject.startRecording();
        identifier = UUID.randomUUID().toString();
        applicationEvent = new TimerTriggeredEvent(identifier);
View Full Code Here

    private AnnotatedSagaManager manager;

    @Before
    public void setUp() throws Exception {
        CorrelationDataHolder.clear();
        sagaRepository = spy(new InMemorySagaRepository());
        manager = new AnnotatedSagaManager(sagaRepository, new SimpleEventBus(), MyTestSaga.class);
    }
View Full Code Here

    public AnnotatedSagaTestFixture(Class<? extends AbstractAnnotatedSaga> sagaType) {
        eventScheduler = new StubEventScheduler();
        GenericSagaFactory genericSagaFactory = new GenericSagaFactory();
        genericSagaFactory.setResourceInjector(new AutowiredResourceInjector(registeredResources));
        EventBus eventBus = new SimpleEventBus();
        InMemorySagaRepository sagaRepository = new InMemorySagaRepository();
        sagaManager = new AnnotatedSagaManager(sagaRepository, genericSagaFactory, sagaType);
        sagaManager.setSuppressExceptions(false);

        registeredResources.add(eventBus);
        commandBus = new RecordingCommandBus();
View Full Code Here

TOP

Related Classes of org.axonframework.saga.repository.inmemory.InMemorySagaRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.