Package org.mule.api.transaction

Examples of org.mule.api.transaction.TransactionFactory


        Service service = new SedaService(muleContext);
        ((AbstractService) service).setExceptionListener(new DefaultMessagingExceptionStrategy(muleContext, true));
        service.setName("testComponent");
        service.setComponent(new DefaultJavaComponent(new PrototypeObjectFactory(JdbcFunctionalTestComponent.class)));

        TransactionFactory tf = getTransactionFactory();
        TransactionConfig txConfig = new MuleTransactionConfig();
        txConfig.setFactory(tf);
        txConfig.setAction(txBeginAction);
       
        EndpointBuilder endpointBuilder = new EndpointURIEndpointBuilder(getInDest(), muleContext);
View Full Code Here


        byte action = (config != null) ? config.getAction() : TransactionConfig.ACTION_DEFAULT;
        Transaction tx = TransactionCoordination.getInstance().getTransaction();
        if (tx == null && context != null && config != null && config.isInteractWithExternal())
        {

            TransactionFactory tmFactory = config.getFactory();
            if (tmFactory instanceof ExternalTransactionAwareTransactionFactory)
            {
                ExternalTransactionAwareTransactionFactory extmFactory =
                    (ExternalTransactionAwareTransactionFactory) tmFactory;
                joinedExternal = tx = extmFactory.joinExternalTransaction(context);
View Full Code Here

        TransactionConfig inboundTransactionConfig = inboundEndpoint.getTransactionConfig();

        if (inboundTransactionConfig.getFactory() == null)
        {
            TransactionFactory transactionFactory = needXA
                                                          ? new XaTransactionFactory()
                                                          : getTransactionFactory(inboundProtocol);

            inboundTransactionConfig.setFactory(transactionFactory);
        }

        TransactionConfig outboundTransactionConfig = outboundEndpoint.getTransactionConfig();

        if (outboundTransactionConfig.getFactory() == null)
        {
            TransactionFactory transactionFactory = needXA
                                                          ? new XaTransactionFactory()
                                                          : getTransactionFactory(outboundProtocol);
            outboundTransactionConfig.setFactory(transactionFactory);
        }
    }
View Full Code Here

        TransactionConfig inboundTransactionConfig = inboundEndpoint.getTransactionConfig();

        if (inboundTransactionConfig.getFactory() == null)
        {
            TransactionFactory transactionFactory = needXA
                                                          ? new XaTransactionFactory()
                                                          : getTransactionFactory(inboundProtocol);

            inboundTransactionConfig.setFactory(transactionFactory);
        }

        TransactionConfig outboundTransactionConfig = outboundEndpoint.getTransactionConfig();

        if (outboundTransactionConfig.getFactory() == null)
        {
            TransactionFactory transactionFactory = needXA
                                                          ? new XaTransactionFactory()
                                                          : getTransactionFactory(outboundProtocol);
            outboundTransactionConfig.setFactory(transactionFactory);
        }
    }
View Full Code Here

        return this.transactionFactories.containsKey(type);
    }
   
    public TransactionFactory getTransactionFactoryFor(Class type)
    {
        TransactionFactory transactionFactory = transactionFactoriesCache.get(type);
        if (transactionFactory == null)
        {
            for (Class transactionResourceType : transactionFactories.keySet())
            {
                if (transactionResourceType.isAssignableFrom(type))
View Full Code Here

        try
        {
            if (tx == null && muleContext != null && transactionConfig != null && transactionConfig.isInteractWithExternal())
            {

                TransactionFactory tmFactory = transactionConfig.getFactory();
                if (tmFactory instanceof ExternalTransactionAwareTransactionFactory)
                {
                    ExternalTransactionAwareTransactionFactory externalTransactionFactory =
                            (ExternalTransactionAwareTransactionFactory) tmFactory;
                    joinedExternal = tx = externalTransactionFactory.joinExternalTransaction(muleContext);
View Full Code Here

    @Test
    public void existingNotOptionalTransaction() throws Exception
    {
        createTestRegistryBootstrap(SimpleRegistryBootstrap.ArtifactType.APP);
        TransactionFactory transactionFactoryFor = muleContext.getTransactionFactoryManager().getTransactionFactoryFor(FakeTransactionResource.class);
        Assert.assertNotNull(transactionFactoryFor);
    }
View Full Code Here

        Service service = new SedaService(muleContext);
        ((AbstractService) service).setExceptionListener(new DefaultMessagingExceptionStrategy(muleContext));
        service.setName("testComponent");
        service.setComponent(new DefaultJavaComponent(new PrototypeObjectFactory(JdbcFunctionalTestComponent.class)));

        TransactionFactory tf = getTransactionFactory();
        TransactionConfig txConfig = new MuleTransactionConfig(txBeginAction);
        txConfig.setFactory(tf);
       
        EndpointBuilder endpointBuilder = new EndpointURIEndpointBuilder(getInDest(), muleContext);
        endpointBuilder.setName("testIn");
View Full Code Here

    {
        if (!(this.delegate instanceof NullTransaction))
        {
            throw new TransactionException(CoreMessages.createStaticMessage("Single resource transaction has already a resource bound"));
        }
        TransactionFactory transactionFactory = muleContext.getTransactionFactoryManager().getTransactionFactoryFor(key.getClass());
        this.unbindTransaction();
        this.delegate = transactionFactory.beginTransaction(muleContext);
        delegate.bindResource(key, resource);
    }
View Full Code Here

TOP

Related Classes of org.mule.api.transaction.TransactionFactory

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.