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,BitronixJtaPlatform,BorlandEnterpriseServerJtaPlatform,JBossAppServerJtaPlatform,JBossStandAloneJtaPlatform,JOnASJtaPlatform,JOTMJtaPlatform,JRun4JtaPlatform,OC4JJtaPlatform,OrionJtaPlatform,ResinJtaPlatform,SapNetWeaverJtaPlatform,SunOneJtaPlatform,TestingJtaPlatformImpl,WeblogicJtaPlatform,WebSphereExtendedJtaPlatform,WebSphereJtaPlatform,WebSphereLibertyJtaPlatform,WildFlyStandAloneJtaPlatform
public abstract class AbstractJtaPlatform extends Object implements JtaPlatform, Configurable, ServiceRegistryAwareService, TransactionManagerAccess
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractJtaPlatform()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleancanCacheTransactionManager()protected booleancanCacheTransactionManagerByDefault()protected booleancanCacheUserTransaction()protected booleancanCacheUserTransactionByDefault()booleancanRegisterSynchronization()Can we currently register aSynchronization?voidconfigure(Map<String,Object> configValues)Configure the service.intgetCurrentStatus()Obtain the current transaction status using whatever means is preferred for this platformprotected JtaSynchronizationStrategygetSynchronizationStrategy()ObjectgetTransactionIdentifier(jakarta.transaction.Transaction transaction)Determine an identifier for the given transaction appropriate for use in caching/lookup usages.jakarta.transaction.TransactionManagergetTransactionManager()Obtain the transaction managervoidinjectServices(ServiceRegistryImplementor serviceRegistry)Callback to inject the registry.protected JndiServicejndiService()protected abstract jakarta.transaction.TransactionManagerlocateTransactionManager()protected abstract jakarta.transaction.UserTransactionlocateUserTransaction()voidregisterSynchronization(jakarta.transaction.Synchronization synchronization)Register a JTASynchronizationin the means defined by the platform.jakarta.transaction.TransactionManagerretrieveTransactionManager()Locate theTransactionManager.jakarta.transaction.UserTransactionretrieveUserTransaction()Locate theUserTransaction.protected ServiceRegistryserviceRegistry()
-
-
-
Method Detail
-
injectServices
public void injectServices(ServiceRegistryImplementor serviceRegistry)
Description copied from interface:ServiceRegistryAwareServiceCallback to inject the registry.- Specified by:
injectServicesin interfaceServiceRegistryAwareService- Parameters:
serviceRegistry- The registry
-
serviceRegistry
protected ServiceRegistry serviceRegistry()
-
jndiService
protected JndiService jndiService()
-
locateTransactionManager
protected abstract jakarta.transaction.TransactionManager locateTransactionManager()
-
locateUserTransaction
protected abstract jakarta.transaction.UserTransaction locateUserTransaction()
-
configure
public void configure(Map<String,Object> configValues)
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
public jakarta.transaction.TransactionManager retrieveTransactionManager()
Description copied from interface:JtaPlatformLocate theTransactionManager.- Specified by:
retrieveTransactionManagerin interfaceJtaPlatform- Returns:
- The
TransactionManager
-
getTransactionManager
public jakarta.transaction.TransactionManager getTransactionManager()
Description copied from interface:TransactionManagerAccessObtain the transaction manager- Specified by:
getTransactionManagerin interfaceTransactionManagerAccess- Returns:
- The transaction manager.
-
retrieveUserTransaction
public jakarta.transaction.UserTransaction retrieveUserTransaction()
Description copied from interface:JtaPlatformLocate theUserTransaction.If
AvailableSettings.PREFER_USER_TRANSACTIONis enabled, Hibernate will use theUserTransactionin preference to theTransactionManagerwhere possible.- Specified by:
retrieveUserTransactionin interfaceJtaPlatform- Returns:
- The
UserTransaction
-
getTransactionIdentifier
public Object getTransactionIdentifier(jakarta.transaction.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
-
getSynchronizationStrategy
protected JtaSynchronizationStrategy getSynchronizationStrategy()
-
registerSynchronization
public void registerSynchronization(jakarta.transaction.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 jakarta.transaction.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:
jakarta.transaction.SystemException- Indicates a problem access the underlying status
-
-