Class AbstractJtaPlatform
java.lang.Object
org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform
- All Implemented Interfaces:
Serializable,TransactionManagerAccess,JtaPlatform,Service,Configurable,ServiceRegistryAwareService
- Direct Known Subclasses:
AtomikosJtaPlatform,GlassFishJtaPlatform,JBossAppServerJtaPlatform,JBossStandAloneJtaPlatform,ResinJtaPlatform,WeblogicJtaPlatform,WebSphereLibertyJtaPlatform,WildFlyStandAloneJtaPlatform
public abstract class AbstractJtaPlatform
extends Object
implements JtaPlatform, Configurable, ServiceRegistryAwareService, TransactionManagerAccess
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected booleanprotected booleanprotected booleanbooleanCan we currently register aSynchronization?voidConfigure the service.intObtain the current transaction status using whatever means is preferred for this platformprotected JtaSynchronizationStrategygetTransactionIdentifier(Transaction transaction) Determine an identifier for the given transaction appropriate for use in caching/lookup usages.Obtain the transaction managervoidinjectServices(ServiceRegistryImplementor serviceRegistry) Callback to inject the registry.protected JndiServiceprotected abstract TransactionManagerprotected abstract UserTransactionvoidregisterSynchronization(Synchronization synchronization) Register a JTASynchronizationin the means defined by the platform.Locate theTransactionManager.Locate theUserTransaction.protected ServiceRegistry
-
Constructor Details
-
AbstractJtaPlatform
public AbstractJtaPlatform()
-
-
Method Details
-
injectServices
Description copied from interface:ServiceRegistryAwareServiceCallback to inject the registry.- Specified by:
injectServicesin interfaceServiceRegistryAwareService- Parameters:
serviceRegistry- The registry
-
serviceRegistry
-
jndiService
-
locateTransactionManager
-
locateUserTransaction
-
configure
Description copied from interface:ConfigurableConfigure the service.- Specified by:
configurein interfaceConfigurable- Parameters:
configValues- The configuration properties.
-
canCacheTransactionManagerByDefault
protected boolean canCacheTransactionManagerByDefault() -
canCacheUserTransactionByDefault
protected boolean canCacheUserTransactionByDefault() -
canCacheTransactionManager
protected boolean canCacheTransactionManager() -
canCacheUserTransaction
protected boolean canCacheUserTransaction() -
retrieveTransactionManager
Description copied from interface:JtaPlatformLocate theTransactionManager.- Specified by:
retrieveTransactionManagerin interfaceJtaPlatform- Returns:
- The
TransactionManager
-
getTransactionManager
Description copied from interface:TransactionManagerAccessObtain the transaction manager- Specified by:
getTransactionManagerin interfaceTransactionManagerAccess- Returns:
- The transaction manager.
-
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
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
-
getSynchronizationStrategy
-
registerSynchronization
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
Description 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
-