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 boolean
canCacheTransactionManager()
protected boolean
canCacheTransactionManagerByDefault()
protected boolean
canCacheUserTransaction()
protected boolean
canCacheUserTransactionByDefault()
boolean
canRegisterSynchronization()
Can we currently register aSynchronization
?void
configure(Map<String,Object> configValues)
Configure the service.int
getCurrentStatus()
Obtain the current transaction status using whatever means is preferred for this platformprotected JtaSynchronizationStrategy
getSynchronizationStrategy()
Object
getTransactionIdentifier(Transaction transaction)
Determine an identifier for the given transaction appropriate for use in caching/lookup usages.TransactionManager
getTransactionManager()
Obtain the transaction managervoid
injectServices(ServiceRegistryImplementor serviceRegistry)
Callback to inject the registry.protected JndiService
jndiService()
protected abstract TransactionManager
locateTransactionManager()
protected abstract UserTransaction
locateUserTransaction()
void
registerSynchronization(Synchronization synchronization)
Register a JTASynchronization
in the means defined by the platform.TransactionManager
retrieveTransactionManager()
Locate theTransactionManager
.UserTransaction
retrieveUserTransaction()
Locate theUserTransaction
.protected ServiceRegistry
serviceRegistry()
-
-
-
Method Detail
-
injectServices
public void injectServices(ServiceRegistryImplementor serviceRegistry)
Description copied from interface:ServiceRegistryAwareService
Callback to inject the registry.- Specified by:
injectServices
in interfaceServiceRegistryAwareService
- Parameters:
serviceRegistry
- The registry
-
serviceRegistry
protected ServiceRegistry serviceRegistry()
-
jndiService
protected JndiService jndiService()
-
locateTransactionManager
protected abstract TransactionManager locateTransactionManager()
-
locateUserTransaction
protected abstract UserTransaction locateUserTransaction()
-
configure
public void configure(Map<String,Object> configValues)
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
public TransactionManager retrieveTransactionManager()
Description copied from interface:JtaPlatform
Locate theTransactionManager
.- Specified by:
retrieveTransactionManager
in interfaceJtaPlatform
- Returns:
- The
TransactionManager
-
getTransactionManager
public TransactionManager getTransactionManager()
Description copied from interface:TransactionManagerAccess
Obtain the transaction manager- Specified by:
getTransactionManager
in interfaceTransactionManagerAccess
- Returns:
- The transaction manager.
-
retrieveUserTransaction
public UserTransaction 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
public Object getTransactionIdentifier(Transaction transaction)
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
protected JtaSynchronizationStrategy getSynchronizationStrategy()
-
registerSynchronization
public void registerSynchronization(Synchronization synchronization)
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
public int getCurrentStatus() throws SystemException
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
-
-