Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved.
*
* This file is part of SeedStack, An enterprise-oriented full development stack.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package org.seedstack.seed.transaction.internal;
import org.seedstack.seed.core.api.Configuration;
import org.seedstack.seed.core.api.SeedException;
import org.seedstack.seed.core.internal.CorePlugin;
import org.seedstack.seed.transaction.api.Propagation;
import org.seedstack.seed.transaction.spi.TransactionHandler;
import org.seedstack.seed.transaction.spi.TransactionMetadata;
import org.aopalliance.intercept.MethodInvocation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.inject.Inject;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.transaction.Status;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;
/**
* This transaction manager delegates to JTA the transactional behavior.
*
* @author [email protected]
*/
public class JtaTransactionManager extends AbstractTransactionManager {
public static final String DEFAULT_USER_TRANSACTION_NAME = "java:comp/UserTransaction";
public static final String[] FALLBACK_TRANSACTION_MANAGER_NAMES = new String[]{"java:comp/TransactionManager", "java:appserver/TransactionManager", "java:pm/TransactionManager", "java:/TransactionManager"};
public static final String DEFAULT_TRANSACTION_SYNCHRONIZATION_REGISTRY_NAME = "java:comp/TransactionSynchronizationRegistry";
private static final Logger LOGGER = LoggerFactory.getLogger(JtaTransactionManager.class);
@Inject
private Context jndiContext;
@Configuration(value = TransactionPlugin.TRANSACTION_PLUGIN_CONFIGURATION_PREFIX + ".jta.tx-manager-name", mandatory = false)
private String transactionManagerName;
@Configuration(value = TransactionPlugin.TRANSACTION_PLUGIN_CONFIGURATION_PREFIX + ".jta.user-tx-name", defaultValue = DEFAULT_USER_TRANSACTION_NAME)
private String userTransactionName;
protected UserTransaction userTransaction;
protected TransactionManager transactionManager;
@Override
protected Object doMethodInterception(String logPrefix, MethodInvocation invocation, TransactionMetadata transactionMetadata, TransactionHandler