Package org.mule.transaction

Examples of org.mule.transaction.MuleTransactionConfig


{
    private ExecutionInterceptor<MuleEvent> executionInterceptor;

    private TransactionalErrorHandlingExecutionTemplate(MuleContext muleContext, MessagingExceptionHandler messagingExceptionHandler, boolean resolveAnyTransaction)
    {
        this(muleContext, new MuleTransactionConfig(), messagingExceptionHandler, resolveAnyTransaction);
    }
View Full Code Here


        {
            @Override
            public ImmutableEndpoint getEndpoint(EndpointBuilder builder) throws MuleException
            {
                builder.setExchangePattern(mep);
                TransactionConfig txConfig = new MuleTransactionConfig(TransactionConfig.ACTION_BEGIN_OR_JOIN);
                txConfig.setFactory(new TestTransactionFactory());
                builder.setTransactionConfig(txConfig);
                return context.getEndpointFactory().getInboundEndpoint(builder);
            }
        }, null);
    }
View Full Code Here

    @Before
    public void setupMocks() throws EndpointException
    {
        when(endpoint.getEndpointURI()).thenReturn(new MuleEndpointURI("test://test", muleContext));
        when(endpoint.getTransactionConfig()).thenReturn(new MuleTransactionConfig());
        when(endpoint.getExchangePattern()).thenReturn(MessageExchangePattern.ONE_WAY);
        when(flow.getProcessingStrategy()).thenReturn(new SynchronousProcessingStrategy());
        when(muleContext.getConfiguration()).thenReturn(mock(MuleConfiguration.class));
    }
View Full Code Here

        // don't wait for ages, has to be set before TX is begun
        tm.setTransactionTimeout(TRANSACTION_TIMEOUT_SECONDS);

        // this is one component with a TX always begin
        TransactionConfig config = new MuleTransactionConfig(TransactionConfig.ACTION_ALWAYS_BEGIN);
        config.setFactory(new XaTransactionFactory());
        ExecutionTemplate<Void> executionTemplate = TransactionalExecutionTemplate.createTransactionalExecutionTemplate(muleContext, config);

        // and the callee component which should begin new transaction, current must be suspended
        final TransactionConfig nestedConfig = new MuleTransactionConfig(TransactionConfig.ACTION_ALWAYS_BEGIN);
        nestedConfig.setFactory(new XaTransactionFactory());

        // start the call chain
        executionTemplate.execute(new ExecutionCallback<Void>()
        {
            public Void process() throws Exception
View Full Code Here

        // don't wait for ages, has to be set before TX is begun
        tm.setTransactionTimeout(TRANSACTION_TIMEOUT_SECONDS);

        // this is one component with a TX always begin
        TransactionConfig config = new MuleTransactionConfig(TransactionConfig.ACTION_ALWAYS_BEGIN);
        config.setFactory(new XaTransactionFactory());
        ExecutionTemplate<Void> executionTemplate = TransactionalExecutionTemplate.createTransactionalExecutionTemplate(muleContext, config);

        // and the callee component which should begin new transaction, current must be suspended
        final TransactionConfig nestedConfig = new MuleTransactionConfig(TransactionConfig.ACTION_NONE);
        nestedConfig.setFactory(new XaTransactionFactory());

        // start the call chain
        executionTemplate.execute(new ExecutionCallback<Void>()
        {
            public Void process() throws Exception
View Full Code Here

        // don't wait for ages, has to be set before TX is begun
        tm.setTransactionTimeout(TRANSACTION_TIMEOUT_SECONDS);

        // this is one service with a TX always begin
        TransactionConfig config = new MuleTransactionConfig(TransactionConfig.ACTION_ALWAYS_BEGIN);
        config.setFactory(new XaTransactionFactory());
        ExecutionTemplate<Void> executionTemplate = TransactionalExecutionTemplate.createTransactionalExecutionTemplate(muleContext, config);

        // and the callee service which should join the current XA transaction, not begin a nested one
        final TransactionConfig nestedConfig = new MuleTransactionConfig(TransactionConfig.ACTION_BEGIN_OR_JOIN);
        nestedConfig.setFactory(new XaTransactionFactory());

        // start the call chain
        executionTemplate.execute(new ExecutionCallback<Void>()
        {
            public Void process() throws Exception
View Full Code Here

        tm = context.getTransactionManager();
    }

    protected <T> ExecutionTemplate<T> createExecutionTemplate(byte action, boolean considerExternal)
    {
        TransactionConfig tc = new MuleTransactionConfig(action);
        tc.setFactory(new XaTransactionFactory());
        tc.setInteractWithExternal(considerExternal);
        ExecutionTemplate<T> executionTemplate = TransactionalExecutionTemplate.createTransactionalExecutionTemplate(context, tc);
        return executionTemplate;
    }
View Full Code Here

        InboundEndpoint endpoint = Mockito.mock(InboundEndpoint.class);
        Mockito.when(endpoint.getExchangePattern()).thenReturn(mep);
        Mockito.when(endpoint.getConnector()).thenReturn(connector);
        Mockito.when(endpoint.getEndpointURI()).thenReturn(new MuleEndpointURI("test://test", muleContext));
        Mockito.when(endpoint.getTransactionConfig()).thenReturn(new MuleTransactionConfig());
        Mockito.when(endpoint.getExchangePattern()).thenReturn(mep);
        Mockito.when(endpoint.getMuleContext()).thenReturn(muleContext);

        MuleEvent responseEvent = Mockito.mock(MuleEvent.class);
        Mockito.when(responseEvent.getSession()).thenReturn(muleSession);
View Full Code Here

        while (client.request("jms://replyTo.queue", 2000) != null)
        {
            // hmm..mesages
        }

        MuleTransactionConfig tc = new MuleTransactionConfig(TransactionConfig.ACTION_ALWAYS_BEGIN);
        tc.setFactory(new JmsTransactionFactory());

        // This enpoint needs to be registered prior to use cause we need to set
        // the transaction config so that the endpoint will "know" it is transacted
        // and not close the session itself but leave it up to the transaction.
        EndpointBuilder endpointBuilder = new EndpointURIEndpointBuilder(
View Full Code Here

        while (client.request("jms://replyTo.queue", 2000) != null)
        {
            // yum!
        }

        MuleTransactionConfig tc = new MuleTransactionConfig(TransactionConfig.ACTION_ALWAYS_BEGIN);
        tc.setFactory(new JmsTransactionFactory());

        // This enpoint needs to be registered prior to use cause we need to set
        // the transaction config so that the endpoint will "know" it is transacted
        // and not close the session itself but leave it up to the transaction.
        EndpointBuilder endpointBuilder = new EndpointURIEndpointBuilder(
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.