Package org.hibernate.testing.jta
Class JtaAwareConnectionProviderImpl
- java.lang.Object
-
- org.hibernate.testing.jta.JtaAwareConnectionProviderImpl
-
- All Implemented Interfaces:
Serializable,org.hibernate.engine.jdbc.connections.spi.ConnectionProvider,org.hibernate.service.Service,org.hibernate.service.spi.Configurable,org.hibernate.service.spi.Stoppable,org.hibernate.service.spi.Wrapped
public class JtaAwareConnectionProviderImpl extends Object implements org.hibernate.engine.jdbc.connections.spi.ConnectionProvider, org.hibernate.service.spi.Configurable, org.hibernate.service.spi.Stoppable
AConnectionProviderimplementation intended for testing Hibernate/JTA interaction. In that limited scope we only ever have one single resource (the database connection) so we do not at all care about full-blown XA semantics. This class behaves accordingly. This class also assumes usage of and access to JBossTS/Arjuna.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJtaAwareConnectionProviderImpl.XAResourceWrapper
-
Constructor Summary
Constructors Constructor Description JtaAwareConnectionProviderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseConnection(Connection conn)voidconfigure(Map configurationValues)protected TransactionfindCurrentTransaction()ConnectiongetConnection()booleanisUnwrappableAs(Class unwrapType)voidstop()booleansupportsAggressiveRelease()<T> Tunwrap(Class<T> unwrapType)
-
-
-
Method Detail
-
configure
public void configure(Map configurationValues)
- Specified by:
configurein interfaceorg.hibernate.service.spi.Configurable
-
stop
public void stop()
- Specified by:
stopin interfaceorg.hibernate.service.spi.Stoppable
-
getConnection
public Connection getConnection() throws SQLException
- Specified by:
getConnectionin interfaceorg.hibernate.engine.jdbc.connections.spi.ConnectionProvider- Throws:
SQLException
-
closeConnection
public void closeConnection(Connection conn) throws SQLException
- Specified by:
closeConnectionin interfaceorg.hibernate.engine.jdbc.connections.spi.ConnectionProvider- Throws:
SQLException
-
supportsAggressiveRelease
public boolean supportsAggressiveRelease()
- Specified by:
supportsAggressiveReleasein interfaceorg.hibernate.engine.jdbc.connections.spi.ConnectionProvider
-
findCurrentTransaction
protected Transaction findCurrentTransaction()
-
isUnwrappableAs
public boolean isUnwrappableAs(Class unwrapType)
- Specified by:
isUnwrappableAsin interfaceorg.hibernate.service.spi.Wrapped
-
unwrap
public <T> T unwrap(Class<T> unwrapType)
- Specified by:
unwrapin interfaceorg.hibernate.service.spi.Wrapped
-
-