Java 类org.springframework.transaction.jta.TransactionFactory 实例源码

项目:lams    文件:AbstractMessageEndpointFactory.java   
/**
 * Set the the XA transaction manager to use for wrapping endpoint
 * invocations, enlisting the endpoint resource in each such transaction.
 * <p>The passed-in object may be a transaction manager which implements
 * Spring's {@link org.springframework.transaction.jta.TransactionFactory}
 * interface, or a plain {@link javax.transaction.TransactionManager}.
 * <p>If no transaction manager is specified, the endpoint invocation
 * will simply not be wrapped in an XA transaction. Check out your
 * resource provider's ActivationSpec documentation for local
 * transaction options of your particular provider.
 * @see #setTransactionName
 * @see #setTransactionTimeout
 */
public void setTransactionManager(Object transactionManager) {
    if (transactionManager instanceof TransactionFactory) {
        this.transactionFactory = (TransactionFactory) transactionManager;
    }
    else if (transactionManager instanceof TransactionManager) {
        this.transactionFactory = new SimpleTransactionFactory((TransactionManager) transactionManager);
    }
    else {
        throw new IllegalArgumentException("Transaction manager [" + transactionManager +
                "] is neither a [org.springframework.transaction.jta.TransactionFactory} nor a " +
                "[javax.transaction.TransactionManager]");
    }
}
项目:spring4-understanding    文件:AbstractMessageEndpointFactory.java   
/**
 * Set the the XA transaction manager to use for wrapping endpoint
 * invocations, enlisting the endpoint resource in each such transaction.
 * <p>The passed-in object may be a transaction manager which implements
 * Spring's {@link org.springframework.transaction.jta.TransactionFactory}
 * interface, or a plain {@link javax.transaction.TransactionManager}.
 * <p>If no transaction manager is specified, the endpoint invocation
 * will simply not be wrapped in an XA transaction. Check out your
 * resource provider's ActivationSpec documentation for local
 * transaction options of your particular provider.
 * @see #setTransactionName
 * @see #setTransactionTimeout
 */
public void setTransactionManager(Object transactionManager) {
    if (transactionManager instanceof TransactionFactory) {
        this.transactionFactory = (TransactionFactory) transactionManager;
    }
    else if (transactionManager instanceof TransactionManager) {
        this.transactionFactory = new SimpleTransactionFactory((TransactionManager) transactionManager);
    }
    else {
        throw new IllegalArgumentException("Transaction manager [" + transactionManager +
                "] is neither a [org.springframework.transaction.jta.TransactionFactory} nor a " +
                "[javax.transaction.TransactionManager]");
    }
}
项目:class-guard    文件:AbstractMessageEndpointFactory.java   
/**
 * Set the the XA transaction manager to use for wrapping endpoint
 * invocations, enlisting the endpoint resource in each such transaction.
 * <p>The passed-in object may be a transaction manager which implements
 * Spring's {@link org.springframework.transaction.jta.TransactionFactory}
 * interface, or a plain {@link javax.transaction.TransactionManager}.
 * <p>If no transaction manager is specified, the endpoint invocation
 * will simply not be wrapped in an XA transaction. Check out your
 * resource provider's ActivationSpec documentation for local
 * transaction options of your particular provider.
 * @see #setTransactionName
 * @see #setTransactionTimeout
 */
public void setTransactionManager(Object transactionManager) {
    if (transactionManager instanceof TransactionFactory) {
        this.transactionFactory = (TransactionFactory) transactionManager;
    }
    else if (transactionManager instanceof TransactionManager) {
        this.transactionFactory = new SimpleTransactionFactory((TransactionManager) transactionManager);
    }
    else {
        throw new IllegalArgumentException("Transaction manager [" + transactionManager +
                "] is neither a [org.springframework.transaction.jta.TransactionFactory} nor a " +
                "[javax.transaction.TransactionManager]");
    }
}
项目:lams    文件:AbstractMessageEndpointFactory.java   
/**
 * Set the Spring TransactionFactory to use for wrapping endpoint
 * invocations, enlisting the endpoint resource in each such transaction.
 * <p>Alternatively, specify an appropriate transaction manager through
 * the {@link #setTransactionManager "transactionManager"} property.
 * <p>If no transaction factory is specified, the endpoint invocation
 * will simply not be wrapped in an XA transaction. Check out your
 * resource provider's ActivationSpec documentation for local
 * transaction options of your particular provider.
 * @see #setTransactionName
 * @see #setTransactionTimeout
 */
public void setTransactionFactory(TransactionFactory transactionFactory) {
    this.transactionFactory = transactionFactory;
}
项目:spring4-understanding    文件:AbstractMessageEndpointFactory.java   
/**
 * Set the Spring TransactionFactory to use for wrapping endpoint
 * invocations, enlisting the endpoint resource in each such transaction.
 * <p>Alternatively, specify an appropriate transaction manager through
 * the {@link #setTransactionManager "transactionManager"} property.
 * <p>If no transaction factory is specified, the endpoint invocation
 * will simply not be wrapped in an XA transaction. Check out your
 * resource provider's ActivationSpec documentation for local
 * transaction options of your particular provider.
 * @see #setTransactionName
 * @see #setTransactionTimeout
 */
public void setTransactionFactory(TransactionFactory transactionFactory) {
    this.transactionFactory = transactionFactory;
}
项目:class-guard    文件:AbstractMessageEndpointFactory.java   
/**
 * Set the Spring TransactionFactory to use for wrapping endpoint
 * invocations, enlisting the endpoint resource in each such transaction.
 * <p>Alternatively, specify an appropriate transaction manager through
 * the {@link #setTransactionManager "transactionManager"} property.
 * <p>If no transaction factory is specified, the endpoint invocation
 * will simply not be wrapped in an XA transaction. Check out your
 * resource provider's ActivationSpec documentation for local
 * transaction options of your particular provider.
 * @see #setTransactionName
 * @see #setTransactionTimeout
 */
public void setTransactionFactory(TransactionFactory transactionFactory) {
    this.transactionFactory = transactionFactory;
}