Package org.mule.transaction

Examples of org.mule.transaction.MuleTransactionConfig


        DefaultMessageProcessorChainBuilder builder = new DefaultMessageProcessorChainBuilder();
        builder.setName("'transaction' child processor chain");
        TransactionalInterceptingMessageProcessor txProcessor =
            new TransactionalInterceptingMessageProcessor();
        txProcessor.setExceptionListener(this.exceptionListener);
        MuleTransactionConfig transactionConfig = createTransactionConfig(this.action);
        txProcessor.setTransactionConfig(transactionConfig);
        transactionConfig.setFactory(getTransactionFactory());
        builder.chain(txProcessor);
        for (Object processor : messageProcessors)
        {
            if (processor instanceof MessageProcessor)
            {
View Full Code Here


        return new DelegateTransactionFactory();
    }

    protected MuleTransactionConfig createTransactionConfig(String action)
    {
        MuleTransactionConfig transactionConfig = new MuleTransactionConfig();
        transactionConfig.setActionAsString(action);
        return transactionConfig;
    }
View Full Code Here

    @Override
    protected void doConfigureInboundEndpointBuilder(MuleContext muleContext, EndpointBuilder endpointBuilder)
    {
        if (transacted)
        {
            MuleTransactionConfig transactionConfig = new MuleTransactionConfig(TransactionConfig.ACTION_BEGIN_OR_JOIN);
            transactionConfig.setMuleContext(muleContext);
            endpointBuilder.setTransactionConfig(transactionConfig);
        }
    }
View Full Code Here

    @Override
    protected void doConfigureOutboundEndpointBuilder(MuleContext muleContext, EndpointBuilder endpointBuilder)
    {
        if (transacted)
        {
            MuleTransactionConfig transactionConfig = new MuleTransactionConfig(TransactionConfig.ACTION_ALWAYS_JOIN);
            transactionConfig.setMuleContext(muleContext);
            endpointBuilder.setTransactionConfig(transactionConfig);
        }
    }
View Full Code Here

        return transactionConfig != null ? transactionConfig : getDefaultTransactionConfig();
    }

    protected TransactionConfig getDefaultTransactionConfig()
    {
        return new MuleTransactionConfig();
    }
View Full Code Here

    private TransactionalExecutionTemplate(MuleContext muleContext, TransactionConfig transactionConfig)
    {
        if (transactionConfig == null)
        {
            transactionConfig = new MuleTransactionConfig();
        }
        final boolean processTransactionOnException = false;
        ExecutionInterceptor<T> tempExecutionInterceptor = new ExecuteCallbackInterceptor<T>();
        tempExecutionInterceptor = new BeginAndResolveTransactionInterceptor<T>(tempExecutionInterceptor,transactionConfig,muleContext, processTransactionOnException, false);
        tempExecutionInterceptor = new ResolvePreviousTransactionInterceptor<T>(tempExecutionInterceptor,transactionConfig);
View Full Code Here

                    try
                    {
                        final AtomicReference exceptionThrownDuringFlowProcessing = new AtomicReference();
                        TransactionalErrorHandlingExecutionTemplate transactionTemplate = TransactionalErrorHandlingExecutionTemplate.
                                createMainExecutionTemplate(messageProcessContext.getFlowConstruct().getMuleContext(),
                                                            (messageProcessContext.getTransactionConfig() == null ? new MuleTransactionConfig() : messageProcessContext.getTransactionConfig()),
                                                            messageProcessContext.getFlowConstruct().getExceptionListener());
                        MuleEvent response = transactionTemplate.execute(new ExecutionCallback<MuleEvent>()
                        {
                            @Override
                            public MuleEvent process() throws Exception
View Full Code Here

                    try
                    {
                        final MessagingExceptionHandler exceptionHandler = messageProcessContext.getFlowConstruct().getExceptionListener();
                        TransactionalErrorHandlingExecutionTemplate transactionTemplate = TransactionalErrorHandlingExecutionTemplate.
                                createMainExecutionTemplate(messageProcessContext.getFlowConstruct().getMuleContext(),
                                                            (messageProcessContext.getTransactionConfig() == null ? new MuleTransactionConfig() : messageProcessContext.getTransactionConfig()),
                                                            exceptionHandler);
                        final MuleEvent response = transactionTemplate.execute(new ExecutionCallback<MuleEvent>()
                        {
                            @Override
                            public MuleEvent process() throws Exception
View Full Code Here

    }

    @Test
    public void testActionIndifferentConfig() throws Exception
    {
        MuleTransactionConfig config = new MuleTransactionConfig(TransactionConfig.ACTION_INDIFFERENT);
        ExecutionTemplate executionTemplate = createExecutionTemplate(config);
        Object result = executionTemplate.execute(getEmptyTransactionCallback());
        assertThat((MuleEvent) result, is(RETURN_VALUE));
        assertThat(TransactionCoordination.getInstance().getTransaction(), IsNull.<Object>nullValue());
    }
View Full Code Here

    }

    @Test
    public void testActionNeverAndNoTx() throws Exception
    {
        MuleTransactionConfig config = new MuleTransactionConfig(TransactionConfig.ACTION_NEVER);
        ExecutionTemplate executionTemplate = createExecutionTemplate(config);
        Object result = executionTemplate.execute(getEmptyTransactionCallback());
        assertThat((MuleEvent) result, is(RETURN_VALUE));
    }
View Full Code Here

TOP

Related Classes of org.mule.transaction.MuleTransactionConfig

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.