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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected boolean
protected boolean
protected boolean
boolean
Can we currently register aSynchronization
?void
Configure the service.int
Obtain the current transaction status using whatever means is preferred for this platformprotected JtaSynchronizationStrategy
getTransactionIdentifier
(Transaction transaction) Determine an identifier for the given transaction appropriate for use in caching/lookup usages.Obtain the transaction managervoid
injectServices
(ServiceRegistryImplementor serviceRegistry) Callback to inject the registry.protected JndiService
protected abstract TransactionManager
protected abstract UserTransaction
void
registerSynchronization
(Synchronization synchronization) Register a JTASynchronization
in the means defined by the platform.Locate theTransactionManager
.Locate theUserTransaction
.protected ServiceRegistry
-
Constructor Details
-
AbstractJtaPlatform
public AbstractJtaPlatform()
-
-
Method Details
-
injectServices
Description copied from interface:ServiceRegistryAwareService
Callback to inject the registry.- Specified by:
injectServices
in interfaceServiceRegistryAwareService
- Parameters:
serviceRegistry
- The registry
-
serviceRegistry
-
jndiService
-
locateTransactionManager
-
locateUserTransaction
-
configure
Description copied from interface:Configurable
Configure the service.- Specified by:
configure
in 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:JtaPlatform
Locate theTransactionManager
.- Specified by:
retrieveTransactionManager
in interfaceJtaPlatform
- Returns:
- The
TransactionManager
-
getTransactionManager
Description copied from interface:TransactionManagerAccess
Obtain the transaction manager- Specified by:
getTransactionManager
in interfaceTransactionManagerAccess
- Returns:
- The transaction manager.
-
retrieveUserTransaction
Description copied from interface:JtaPlatform
Locate theUserTransaction
.If
TransactionSettings.PREFER_USER_TRANSACTION
is enabled, Hibernate will use theUserTransaction
in preference to theTransactionManager
where possible.- Specified by:
retrieveUserTransaction
in interfaceJtaPlatform
- Returns:
- The
UserTransaction
-
getTransactionIdentifier
Description copied from interface:JtaPlatform
Determine 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:
getTransactionIdentifier
in interfaceJtaPlatform
- Parameters:
transaction
- The transaction to be identified.- Returns:
- An appropriate identifier
-
getSynchronizationStrategy
-
registerSynchronization
Description copied from interface:JtaPlatform
Register a JTASynchronization
in the means defined by the platform.- Specified by:
registerSynchronization
in interfaceJtaPlatform
- Parameters:
synchronization
- The synchronization to register
-
canRegisterSynchronization
public boolean canRegisterSynchronization()Description copied from interface:JtaPlatform
Can we currently register aSynchronization
?- Specified by:
canRegisterSynchronization
in interfaceJtaPlatform
- Returns:
- True if registering a
Synchronization
is currently allowed; false otherwise.
-
getCurrentStatus
Description copied from interface:JtaPlatform
Obtain the current transaction status using whatever means is preferred for this platform- Specified by:
getCurrentStatus
in interfaceJtaPlatform
- Returns:
- The current status.
- Throws:
SystemException
- Indicates a problem access the underlying status
-