Class NoJtaPlatform
- java.lang.Object
-
- org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform
-
- All Implemented Interfaces:
Serializable,JtaPlatform,Service
public class NoJtaPlatform extends Object implements JtaPlatform
The non-configured form of JTA platform. This is what is used if none was set up.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static NoJtaPlatformINSTANCE
-
Constructor Summary
Constructors Constructor Description NoJtaPlatform()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanRegisterSynchronization()Can we currently register aSynchronization?intgetCurrentStatus()Obtain the current transaction status using whatever means is preferred for this platform@Nullable ObjectgetTransactionIdentifier(Transaction transaction)Determine an identifier for the given transaction appropriate for use in caching/lookup usages.voidregisterSynchronization(Synchronization synchronization)Register a JTASynchronizationin the means defined by the platform.@Nullable TransactionManagerretrieveTransactionManager()Locate theTransactionManager.@Nullable UserTransactionretrieveUserTransaction()Locate theUserTransaction.
-
-
-
Field Detail
-
INSTANCE
public static final NoJtaPlatform INSTANCE
-
-
Method Detail
-
retrieveTransactionManager
public @Nullable TransactionManager retrieveTransactionManager()
Description copied from interface:JtaPlatformLocate theTransactionManager.- Specified by:
retrieveTransactionManagerin interfaceJtaPlatform- Returns:
- The
TransactionManager
-
retrieveUserTransaction
public @Nullable UserTransaction retrieveUserTransaction()
Description copied from interface:JtaPlatformLocate theUserTransaction.If
TransactionSettings.PREFER_USER_TRANSACTIONis enabled, Hibernate will use theUserTransactionin preference to theTransactionManagerwhere possible.- Specified by:
retrieveUserTransactionin interfaceJtaPlatform- Returns:
- The
UserTransaction
-
getTransactionIdentifier
public @Nullable Object getTransactionIdentifier(Transaction transaction)
Description copied from interface:JtaPlatformDetermine an identifier for the given transaction appropriate for use in caching/lookup usages.Generally speaking the transaction itself will be returned here. This method was added specifically for use in WebSphere and other unfriendly Java EE containers.
- Specified by:
getTransactionIdentifierin interfaceJtaPlatform- Parameters:
transaction- The transaction to be identified.- Returns:
- An appropriate identifier
-
registerSynchronization
public void registerSynchronization(Synchronization synchronization)
Description copied from interface:JtaPlatformRegister a JTASynchronizationin the means defined by the platform.- Specified by:
registerSynchronizationin interfaceJtaPlatform- Parameters:
synchronization- The synchronization to register
-
canRegisterSynchronization
public boolean canRegisterSynchronization()
Description copied from interface:JtaPlatformCan we currently register aSynchronization?- Specified by:
canRegisterSynchronizationin interfaceJtaPlatform- Returns:
- True if registering a
Synchronizationis currently allowed; false otherwise.
-
getCurrentStatus
public int getCurrentStatus() throws SystemExceptionDescription copied from interface:JtaPlatformObtain the current transaction status using whatever means is preferred for this platform- Specified by:
getCurrentStatusin interfaceJtaPlatform- Returns:
- The current status.
- Throws:
SystemException- Indicates a problem access the underlying status
-
-