Package org.axonframework.unitofwork

Examples of org.axonframework.unitofwork.NoTransactionManager


        // since we don't need transactions in this in-memory sample, we use a NoTransactionManager
        // the 0 means we do not need any "intermediate commit" during the replay.
        // The BackloggingIncomingMessageHandler will make sure any events published while replaying are backlogged
        // and postponed until the replay is done.
        ReplayingCluster replayingCluster = new ReplayingCluster(new SimpleCluster("simple"), eventStore,
                                                                 new NoTransactionManager(), 0,
                                                                 new BackloggingIncomingMessageHandler());

        // we initialize an event bus that contains our replaying cluster
        EventBus eventBus = new ClusteringEventBus(new DefaultClusterSelector(replayingCluster));
View Full Code Here


        verify(transactionalChannel).close();
    }

    @Test
    public void testSendMessage_WithTransactionalUnitOfWork() throws IOException {
        TransactionManager<?> mockTransaction = new NoTransactionManager();
        UnitOfWork uow = DefaultUnitOfWork.startAndGet(mockTransaction);

        Connection connection = mock(Connection.class);
        when(connectionFactory.createConnection()).thenReturn(connection);
        Channel transactionalChannel = mock(Channel.class);
View Full Code Here

        verify(transactionalChannel).close();
    }

    @Test
    public void testSendMessage_WithTransactionalUnitOfWork_ChannelClosedBeforeCommit() throws IOException {
        TransactionManager<?> mockTransaction = new NoTransactionManager();
        UnitOfWork uow = DefaultUnitOfWork.startAndGet(mockTransaction);

        Connection connection = mock(Connection.class);
        when(connectionFactory.createConnection()).thenReturn(connection);
        Channel transactionalChannel = mock(Channel.class);
View Full Code Here

                    .getBeanDefinition());
        } else {
            constructor.addIndexedArgumentValue(2, BeanDefinitionBuilder
                    .genericBeanDefinition(TransactionManagerFactoryBean.class)
                    .addPropertyValue("transactionManager",
                                      createAutowiredBeanWithFallback(new NoTransactionManager(),
                                                                      TransactionManager.class,
                                                                      PlatformTransactionManager.class))
                    .getBeanDefinition());
        }
        constructor.addIndexedArgumentValue(3, replayElement.getAttribute(COMMIT_THRESHOLD_ATTRIBUTE));
View Full Code Here

TOP

Related Classes of org.axonframework.unitofwork.NoTransactionManager

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.