@Deprecated public class SpringTransactionHooks extends Object implements org.springframework.beans.factory.BeanFactoryAware
This class defines before and after hooks which provide automatic spring rollback capabilities.
These hooks will apply to any element(s) within a .feature
file tagged with @txn
.
Clients wishing to leverage these hooks should include this class' package in the glue
code.
The BEFORE and AFTER hooks (both with hook order 100) rely on being able to obtain a PlatformTransactionManager
by type, or
by an optionally specified bean name, from the runtime BeanFactory
.
NOTE: This class is NOT threadsafe! It relies on the fact that cucumber-jvm will instantiate an instance of any applicable hookdef class per scenario run.
Constructor and Description |
---|
SpringTransactionHooks()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
org.springframework.transaction.TransactionStatus |
getTransactionStatus()
Deprecated.
|
String |
getTxnManagerBeanName()
Deprecated.
|
org.springframework.transaction.PlatformTransactionManager |
obtainPlatformTransactionManager()
Deprecated.
|
void |
rollBackTransaction()
Deprecated.
|
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
Deprecated.
|
void |
setTransactionStatus(org.springframework.transaction.support.SimpleTransactionStatus transactionStatus)
Deprecated.
|
void |
setTxnManagerBeanName(String txnManagerBeanName)
Deprecated.
Setter to allow (optional) bean name to be specified for transaction manager bean - if null, attempt will be made to find a transaction manager by bean type
|
void |
startTransaction()
Deprecated.
|
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException
public String getTxnManagerBeanName()
public void setTxnManagerBeanName(String txnManagerBeanName)
txnManagerBeanName
- bean name of transaction manager beanpublic void startTransaction()
public void rollBackTransaction()
public org.springframework.transaction.PlatformTransactionManager obtainPlatformTransactionManager()
public org.springframework.transaction.TransactionStatus getTransactionStatus()
public void setTransactionStatus(org.springframework.transaction.support.SimpleTransactionStatus transactionStatus)
Copyright © 2019. All rights reserved.