Package org.axonframework.saga.annotation

Examples of org.axonframework.saga.annotation.AnnotatedSagaManager


        GenericSagaFactory sagaFactory = new GenericSagaFactory();
        // this will allow the eventScheduler and commandGateway to be injected in our Saga
        sagaFactory.setResourceInjector(new SimpleResourceInjector(eventScheduler, commandGateway));

        // Sagas instances are managed and tracked by a SagaManager.
        AnnotatedSagaManager sagaManager = new AnnotatedSagaManager(sagaRepository, sagaFactory,
                eventBus, ToDoSaga.class);

        // and we need to subscribe the Saga Manager to the Event Bus
        sagaManager.subscribe();

        // That's the infrastructure we need...
        // Let's pretend a few things are happening

        // We create 2 items
View Full Code Here


    }

    @SuppressWarnings("unchecked")
    @Test
    public void testConcurrentAccessToSaga_NotSynchronized() throws Throwable {
        sagaManager = new AnnotatedSagaManager(repository, eventBus, ConcurrentSaga.class);
        sagaManager.setSynchronizeSagaAccess(false);
        executeConcurrentAccessToSaga(ConcurrentSaga.class);
    }
View Full Code Here

        executeConcurrentAccessToSaga(ConcurrentSaga.class);
    }

    @Test
    public void testConcurrentAccessToSaga_Synchronized() throws Throwable {
        sagaManager = new AnnotatedSagaManager(repository, eventBus, NonConcurrentSaga.class);
        sagaManager.setSynchronizeSagaAccess(true);
        executeConcurrentAccessToSaga(NonConcurrentSaga.class);
    }
View Full Code Here

        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();
        registeredResources.add(commandBus);
View Full Code Here

TOP

Related Classes of org.axonframework.saga.annotation.AnnotatedSagaManager

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.