Example usage for javax.transaction UserTransaction getClass

List of usage examples for javax.transaction UserTransaction getClass

Introduction

In this page you can find the example usage for javax.transaction UserTransaction getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.springframework.transaction.jta.SpringJtaSynchronizationAdapter.java

/**
 * Create a new SpringJtaSynchronizationAdapter for the given Spring
 * TransactionSynchronization and JTA TransactionManager.
 * <p>Note that this adapter will never perform a rollback-only call on WebLogic,
 * since WebLogic Server is known to automatically mark the transaction as
 * rollback-only in case of a {@code beforeCompletion} exception. Hence,
 * on WLS, this constructor is equivalent to the single-arg constructor.
 * @param springSynchronization the Spring TransactionSynchronization to delegate to
 * @param jtaUserTransaction the JTA UserTransaction to use for rollback-only
 * setting in case of an exception thrown in {@code beforeCompletion}
 * (can be omitted if the JTA provider itself marks the transaction rollback-only
 * in such a scenario, which is required by the JTA specification as of JTA 1.1).
 *///from   ww w  .j a va  2  s .  c  o  m
public SpringJtaSynchronizationAdapter(TransactionSynchronization springSynchronization,
        @Nullable UserTransaction jtaUserTransaction) {

    this(springSynchronization);
    if (jtaUserTransaction != null && !jtaUserTransaction.getClass().getName().startsWith("weblogic.")) {
        this.jtaTransaction = jtaUserTransaction;
    }
}