Search in sources :

Example 1 with TransactionType

use of org.mule.runtime.api.tx.TransactionType in project mule by mulesoft.

the class ExtensionMessageSource method buildTransactionConfig.

private TransactionConfig buildTransactionConfig() {
    MuleTransactionConfig transactionConfig = new MuleTransactionConfig();
    transactionConfig.setAction(toActionCode(sourceAdapter.getTransactionalAction()));
    transactionConfig.setMuleContext(muleContext);
    TransactionType transactionalType = sourceAdapter.getTransactionalType();
    transactionConfig.setFactory(transactionFactoryLocator.lookUpTransactionFactory(transactionalType).orElseThrow(() -> new IllegalStateException(format("Unable to create Source with Transactions of Type: [%s]. No factory available for this transaction type", transactionalType))));
    return transactionConfig;
}
Also used : TransactionType(org.mule.runtime.api.tx.TransactionType) MuleTransactionConfig(org.mule.runtime.core.api.transaction.MuleTransactionConfig)

Aggregations

TransactionType (org.mule.runtime.api.tx.TransactionType)1 MuleTransactionConfig (org.mule.runtime.core.api.transaction.MuleTransactionConfig)1