Added @Override annotations to transaction module
This commit is contained in:
parent
77ad22e338
commit
aa60746155
|
|
@ -119,6 +119,7 @@ public class CciLocalTransactionManager extends AbstractPlatformTransactionManag
|
|||
return getConnectionFactory();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object doGetTransaction() {
|
||||
CciLocalTransactionObject txObject = new CciLocalTransactionObject();
|
||||
ConnectionHolder conHolder =
|
||||
|
|
@ -127,12 +128,14 @@ public class CciLocalTransactionManager extends AbstractPlatformTransactionManag
|
|||
return txObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isExistingTransaction(Object transaction) {
|
||||
CciLocalTransactionObject txObject = (CciLocalTransactionObject) transaction;
|
||||
// Consider a pre-bound connection as transaction.
|
||||
return (txObject.getConnectionHolder() != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doBegin(Object transaction, TransactionDefinition definition) {
|
||||
CciLocalTransactionObject txObject = (CciLocalTransactionObject) transaction;
|
||||
|
||||
|
|
@ -169,12 +172,14 @@ public class CciLocalTransactionManager extends AbstractPlatformTransactionManag
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object doSuspend(Object transaction) {
|
||||
CciLocalTransactionObject txObject = (CciLocalTransactionObject) transaction;
|
||||
txObject.setConnectionHolder(null);
|
||||
return TransactionSynchronizationManager.unbindResource(getConnectionFactory());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doResume(Object transaction, Object suspendedResources) {
|
||||
ConnectionHolder conHolder = (ConnectionHolder) suspendedResources;
|
||||
TransactionSynchronizationManager.bindResource(getConnectionFactory(), conHolder);
|
||||
|
|
@ -185,6 +190,7 @@ public class CciLocalTransactionManager extends AbstractPlatformTransactionManag
|
|||
return txObject.getConnectionHolder().isRollbackOnly();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doCommit(DefaultTransactionStatus status) {
|
||||
CciLocalTransactionObject txObject = (CciLocalTransactionObject) status.getTransaction();
|
||||
Connection con = txObject.getConnectionHolder().getConnection();
|
||||
|
|
@ -202,6 +208,7 @@ public class CciLocalTransactionManager extends AbstractPlatformTransactionManag
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doRollback(DefaultTransactionStatus status) {
|
||||
CciLocalTransactionObject txObject = (CciLocalTransactionObject) status.getTransaction();
|
||||
Connection con = txObject.getConnectionHolder().getConnection();
|
||||
|
|
@ -219,6 +226,7 @@ public class CciLocalTransactionManager extends AbstractPlatformTransactionManag
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doSetRollbackOnly(DefaultTransactionStatus status) {
|
||||
CciLocalTransactionObject txObject = (CciLocalTransactionObject) status.getTransaction();
|
||||
if (status.isDebug()) {
|
||||
|
|
@ -228,6 +236,7 @@ public class CciLocalTransactionManager extends AbstractPlatformTransactionManag
|
|||
txObject.getConnectionHolder().setRollbackOnly();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doCleanupAfterCompletion(Object transaction) {
|
||||
CciLocalTransactionObject txObject = (CciLocalTransactionObject) transaction;
|
||||
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ public abstract class ConnectionFactoryUtils {
|
|||
super(connectionHolder, connectionFactory);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void releaseResource(ResourceHolder resourceHolder, Object resourceKey) {
|
||||
releaseConnection(((ConnectionHolder) resourceHolder).getConnection(), (ConnectionFactory) resourceKey);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ public class ConnectionSpecConnectionFactoryAdapter extends DelegatingConnection
|
|||
* "connectionSpec" property else.
|
||||
* @see #doGetConnection
|
||||
*/
|
||||
@Override
|
||||
public final Connection getConnection() throws ResourceException {
|
||||
ConnectionSpec threadSpec = (ConnectionSpec) this.threadBoundSpec.get();
|
||||
if (threadSpec != null) {
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory impleme
|
|||
/**
|
||||
* Make sure a Connection or ConnectionFactory has been set.
|
||||
*/
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
if (this.connection == null && getTargetConnectionFactory() == null) {
|
||||
throw new IllegalArgumentException("Connection or 'targetConnectionFactory' is required");
|
||||
|
|
@ -105,6 +106,7 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory impleme
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Connection getConnection() throws ResourceException {
|
||||
synchronized (this.connectionMonitor) {
|
||||
if (this.connection == null) {
|
||||
|
|
@ -114,6 +116,7 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory impleme
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connection getConnection(ConnectionSpec connectionSpec) throws ResourceException {
|
||||
throw new NotSupportedException(
|
||||
"SingleConnectionFactory does not support custom ConnectionSpec");
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ public class TransactionAwareConnectionFactoryProxy extends DelegatingConnection
|
|||
* @return a transactional Connection if any, a new one else
|
||||
* @see org.springframework.jca.cci.connection.ConnectionFactoryUtils#doGetConnection
|
||||
*/
|
||||
@Override
|
||||
public Connection getConnection() throws ResourceException {
|
||||
Connection con = ConnectionFactoryUtils.doGetConnection(getTargetConnectionFactory());
|
||||
return getTransactionAwareConnectionProxy(con, getTargetConnectionFactory());
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ public abstract class CciDaoSupport extends DaoSupport {
|
|||
return this.cciTemplate;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void checkDaoConfig() {
|
||||
if (this.cciTemplate == null) {
|
||||
throw new IllegalArgumentException("'connectionFactory' or 'cciTemplate' is required");
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ public class CommAreaRecord implements Record, Streamable {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
return new CommAreaRecord(this.bytes);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public abstract class MappingCommAreaOperation extends MappingRecordOperation {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected final Record createInputRecord(RecordFactory recordFactory, Object inObject) {
|
||||
try {
|
||||
return new CommAreaRecord(objectToBytes(inObject));
|
||||
|
|
@ -63,6 +64,7 @@ public abstract class MappingCommAreaOperation extends MappingRecordOperation {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final Object extractOutputData(Record record) throws DataAccessException {
|
||||
CommAreaRecord commAreaRecord = (CommAreaRecord) record;
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ public class ResourceAdapterApplicationContext extends GenericApplicationContext
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
|
||||
beanFactory.addBeanPostProcessor(new BootstrapContextAwareProcessor(this.bootstrapContext));
|
||||
beanFactory.ignoreDependencyInterface(BootstrapContextAware.class);
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ public class GenericMessageEndpointFactory extends AbstractMessageEndpointFactor
|
|||
* exposing the message listener's interfaces as well as the
|
||||
* endpoint SPI through an AOP introduction.
|
||||
*/
|
||||
@Override
|
||||
public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException {
|
||||
GenericMessageEndpoint endpoint = (GenericMessageEndpoint) super.createEndpoint(xaResource);
|
||||
ProxyFactory proxyFactory = new ProxyFactory(this.messageListener);
|
||||
|
|
@ -81,6 +82,7 @@ public class GenericMessageEndpointFactory extends AbstractMessageEndpointFactor
|
|||
/**
|
||||
* Creates a concrete generic message endpoint, internal to this factory.
|
||||
*/
|
||||
@Override
|
||||
protected AbstractMessageEndpoint createEndpointInternal() throws UnavailableException {
|
||||
return new GenericMessageEndpoint();
|
||||
}
|
||||
|
|
@ -131,6 +133,7 @@ public class GenericMessageEndpointFactory extends AbstractMessageEndpointFactor
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassLoader getEndpointClassLoader() {
|
||||
return messageListener.getClass().getClassLoader();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ public class GlassFishWorkManagerTaskExecutor extends WorkManagerTaskExecutor {
|
|||
/**
|
||||
* Obtains GlassFish's default thread pool.
|
||||
*/
|
||||
@Override
|
||||
protected WorkManager getDefaultWorkManager() {
|
||||
return (WorkManager) ReflectionUtils.invokeMethod(this.getWorkManagerMethod, null, new Object[] {null});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ public class JBossWorkManagerTaskExecutor extends WorkManagerTaskExecutor {
|
|||
* for the JBossWorkManagerMBean.
|
||||
* @see JBossWorkManagerUtils#getWorkManager()
|
||||
*/
|
||||
@Override
|
||||
protected WorkManager getDefaultWorkManager() {
|
||||
return JBossWorkManagerUtils.getWorkManager();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ public class TransactionSystemException extends TransactionException {
|
|||
return (this.applicationException != null ? this.applicationException : getCause());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(Class exType) {
|
||||
return super.contains(exType) || (exType != null && exType.isInstance(this.applicationException));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,10 +112,12 @@ public class AnnotationTransactionAttributeSource extends AbstractFallbackTransa
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected TransactionAttribute findTransactionAttribute(Method method) {
|
||||
return determineTransactionAttribute(method);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TransactionAttribute findTransactionAttribute(Class clazz) {
|
||||
return determineTransactionAttribute(clazz);
|
||||
}
|
||||
|
|
@ -144,15 +146,18 @@ public class AnnotationTransactionAttributeSource extends AbstractFallbackTransa
|
|||
/**
|
||||
* By default, only public methods can be made transactional.
|
||||
*/
|
||||
@Override
|
||||
protected boolean allowPublicMethodsOnly() {
|
||||
return this.publicMethodsOnly;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
return (this == other || other instanceof AnnotationTransactionAttributeSource);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return AnnotationTransactionAttributeSource.class.hashCode();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ public class JtaTransactionManagerBeanDefinitionParser extends AbstractSingleBea
|
|||
"oracle.j2ee.transaction.OC4JTransactionManager", JtaTransactionManagerBeanDefinitionParser.class.getClassLoader());
|
||||
|
||||
|
||||
@Override
|
||||
protected String getBeanClassName(Element element) {
|
||||
if (weblogicPresent) {
|
||||
return WEBLOGIC_JTA_TRANSACTION_MANAGER_CLASS_NAME;
|
||||
|
|
@ -74,6 +75,7 @@ public class JtaTransactionManagerBeanDefinitionParser extends AbstractSingleBea
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext) {
|
||||
return DEFAULT_TRANSACTION_MANAGER_BEAN_NAME;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,10 +63,12 @@ class TxAdviceBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
|
|||
private static final String NO_ROLLBACK_FOR = "no-rollback-for";
|
||||
|
||||
|
||||
@Override
|
||||
protected Class getBeanClass(Element element) {
|
||||
return TransactionInterceptor.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
|
||||
// Set the transaction manager property.
|
||||
String transactionManagerName = (element.hasAttribute(TxNamespaceUtils.TRANSACTION_MANAGER_ATTRIBUTE) ?
|
||||
|
|
|
|||
|
|
@ -210,6 +210,7 @@ public abstract class AbstractFallbackTransactionAttributeSource implements Tran
|
|||
this.targetClass = targetClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
|
|
@ -222,6 +223,7 @@ public abstract class AbstractFallbackTransactionAttributeSource implements Tran
|
|||
ObjectUtils.nullSafeEquals(this.targetClass, otherKey.targetClass));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.method.hashCode() * 29 + (this.targetClass != null ? this.targetClass.hashCode() : 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ public class BeanFactoryTransactionAttributeSourceAdvisor extends AbstractBeanFa
|
|||
private TransactionAttributeSource transactionAttributeSource;
|
||||
|
||||
private final TransactionAttributeSourcePointcut pointcut = new TransactionAttributeSourcePointcut() {
|
||||
@Override
|
||||
protected TransactionAttributeSource getTransactionAttributeSource() {
|
||||
return transactionAttributeSource;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,14 +69,17 @@ public abstract class DelegatingTransactionAttribute implements TransactionAttri
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return this.targetAttribute.equals(obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.targetAttribute.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.targetAttribute.toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public class MatchAlwaysTransactionAttributeSource implements TransactionAttribu
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
|
|
@ -65,10 +66,12 @@ public class MatchAlwaysTransactionAttributeSource implements TransactionAttribu
|
|||
return ObjectUtils.nullSafeEquals(this.transactionAttribute, otherTas.transactionAttribute);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return MatchAlwaysTransactionAttributeSource.class.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + ": " + this.transactionAttribute;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,6 +247,7 @@ public class MethodMapTransactionAttributeSource
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
|
|
@ -258,10 +259,12 @@ public class MethodMapTransactionAttributeSource
|
|||
return ObjectUtils.nullSafeEquals(this.methodMap, otherTas.methodMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return MethodMapTransactionAttributeSource.class.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + ": " + this.methodMap;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@ public class NameMatchTransactionAttributeSource implements TransactionAttribute
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
|
|
@ -157,10 +158,12 @@ public class NameMatchTransactionAttributeSource implements TransactionAttribute
|
|||
return ObjectUtils.nullSafeEquals(this.nameMap, otherTas.nameMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return NameMatchTransactionAttributeSource.class.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + ": " + this.nameMap;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ public class NoRollbackRuleAttribute extends RollbackRuleAttribute {
|
|||
super(exceptionName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "No" + super.toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ public class RollbackRuleAttribute implements Serializable{
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
|
|
@ -133,10 +134,12 @@ public class RollbackRuleAttribute implements Serializable{
|
|||
return this.exceptionName.equals(rhs.exceptionName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.exceptionName.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RollbackRuleAttribute with pattern [" + this.exceptionName + "]";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ public class RuleBasedTransactionAttribute extends DefaultTransactionAttribute i
|
|||
* return false.
|
||||
* @see TransactionAttribute#rollbackOn(java.lang.Throwable)
|
||||
*/
|
||||
@Override
|
||||
public boolean rollbackOn(Throwable ex) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Applying rules to determine whether transaction should rollback on " + ex);
|
||||
|
|
@ -158,6 +159,7 @@ public class RuleBasedTransactionAttribute extends DefaultTransactionAttribute i
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer result = getDefinitionDescription();
|
||||
if (this.rollbackRules != null) {
|
||||
|
|
|
|||
|
|
@ -250,6 +250,7 @@ public abstract class TransactionAspectSupport implements InitializingBean {
|
|||
// If no name specified, apply method identification as transaction name.
|
||||
if (txAttr != null && txAttr.getName() == null) {
|
||||
txAttr = new DelegatingTransactionAttribute(txAttr) {
|
||||
@Override
|
||||
public String getName() {
|
||||
return joinpointIdentification;
|
||||
}
|
||||
|
|
@ -447,6 +448,7 @@ public abstract class TransactionAspectSupport implements InitializingBean {
|
|||
transactionInfoHolder.set(this.oldTransactionInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.transactionAttribute.toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ public class TransactionAttributeEditor extends PropertyEditorSupport {
|
|||
* Null or the empty string means that the method is non transactional.
|
||||
* @see java.beans.PropertyEditor#setAsText(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setAsText(String text) throws IllegalArgumentException {
|
||||
if (StringUtils.hasLength(text)) {
|
||||
// tokenize it with ","
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ public class TransactionAttributeSourceAdvisor extends AbstractPointcutAdvisor {
|
|||
private TransactionInterceptor transactionInterceptor;
|
||||
|
||||
private final TransactionAttributeSourcePointcut pointcut = new TransactionAttributeSourcePointcut() {
|
||||
@Override
|
||||
protected TransactionAttributeSource getTransactionAttributeSource() {
|
||||
return (transactionInterceptor != null ? transactionInterceptor.getTransactionAttributeSource() : null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ import org.springframework.util.StringUtils;
|
|||
*/
|
||||
public class TransactionAttributeSourceEditor extends PropertyEditorSupport {
|
||||
|
||||
@Override
|
||||
public void setAsText(String text) throws IllegalArgumentException {
|
||||
MethodMapTransactionAttributeSource source = new MethodMapTransactionAttributeSource();
|
||||
if (StringUtils.hasLength(text)) {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ abstract class TransactionAttributeSourcePointcut extends StaticMethodMatcherPoi
|
|||
return (tas == null || tas.getTransactionAttribute(method, targetClass) != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
|
|
@ -47,10 +48,12 @@ abstract class TransactionAttributeSourcePointcut extends StaticMethodMatcherPoi
|
|||
return ObjectUtils.nullSafeEquals(getTransactionAttributeSource(), otherPc.getTransactionAttributeSource());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return TransactionAttributeSourcePointcut.class.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + ": " + getTransactionAttributeSource();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,6 +216,7 @@ public class TransactionInterceptor extends TransactionAspectSupport implements
|
|||
super(throwable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getCause().toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,6 +184,7 @@ public class TransactionProxyFactoryBean extends AbstractSingletonProxyFactoryBe
|
|||
/**
|
||||
* Creates an advisor for this FactoryBean's TransactionInterceptor.
|
||||
*/
|
||||
@Override
|
||||
protected Object createMainInterceptor() {
|
||||
this.transactionInterceptor.afterPropertiesSet();
|
||||
if (this.pointcut != null) {
|
||||
|
|
|
|||
|
|
@ -790,6 +790,7 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
|||
* flag to enforce a fresh lookup for every transaction.
|
||||
* @see #setCacheUserTransaction
|
||||
*/
|
||||
@Override
|
||||
protected Object doGetTransaction() {
|
||||
UserTransaction ut = getUserTransaction();
|
||||
if (ut == null) {
|
||||
|
|
@ -814,6 +815,7 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
|||
return new JtaTransactionObject(ut);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isExistingTransaction(Object transaction) {
|
||||
JtaTransactionObject txObject = (JtaTransactionObject) transaction;
|
||||
try {
|
||||
|
|
@ -832,11 +834,13 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
|||
* @see #doBegin
|
||||
* @see javax.transaction.UserTransaction#begin()
|
||||
*/
|
||||
@Override
|
||||
protected boolean useSavepointForNestedTransaction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void doBegin(Object transaction, TransactionDefinition definition) {
|
||||
JtaTransactionObject txObject = (JtaTransactionObject) transaction;
|
||||
try {
|
||||
|
|
@ -927,6 +931,7 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Object doSuspend(Object transaction) {
|
||||
JtaTransactionObject txObject = (JtaTransactionObject) transaction;
|
||||
try {
|
||||
|
|
@ -955,6 +960,7 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
|||
return getTransactionManager().suspend();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doResume(Object transaction, Object suspendedResources) {
|
||||
JtaTransactionObject txObject = (JtaTransactionObject) transaction;
|
||||
try {
|
||||
|
|
@ -997,10 +1003,12 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
|||
* This implementation returns "true": a JTA commit will properly handle
|
||||
* transactions that have been marked rollback-only at a global level.
|
||||
*/
|
||||
@Override
|
||||
protected boolean shouldCommitOnGlobalRollbackOnly() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doCommit(DefaultTransactionStatus status) {
|
||||
JtaTransactionObject txObject = (JtaTransactionObject) status.getTransaction();
|
||||
try {
|
||||
|
|
@ -1045,6 +1053,7 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doRollback(DefaultTransactionStatus status) {
|
||||
JtaTransactionObject txObject = (JtaTransactionObject) status.getTransaction();
|
||||
try {
|
||||
|
|
@ -1071,6 +1080,7 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doSetRollbackOnly(DefaultTransactionStatus status) {
|
||||
JtaTransactionObject txObject = (JtaTransactionObject) status.getTransaction();
|
||||
if (status.isDebug()) {
|
||||
|
|
@ -1091,6 +1101,7 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void registerAfterCompletionWithExistingTransaction(Object transaction, List synchronizations) {
|
||||
JtaTransactionObject txObject = (JtaTransactionObject) transaction;
|
||||
logger.debug("Registering after-completion synchronization with existing JTA transaction");
|
||||
|
|
|
|||
|
|
@ -89,11 +89,13 @@ public class OC4JJtaTransactionManager extends JtaTransactionManager {
|
|||
private Method setTransactionIsolationMethod;
|
||||
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws TransactionSystemException {
|
||||
super.afterPropertiesSet();
|
||||
loadOC4JTransactionClasses();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected UserTransaction retrieveUserTransaction() throws TransactionSystemException {
|
||||
try {
|
||||
Class transactionUtilityClass = getClass().getClassLoader().loadClass(TRANSACTION_UTILITY_CLASS_NAME);
|
||||
|
|
@ -153,6 +155,7 @@ public class OC4JJtaTransactionManager extends JtaTransactionManager {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void doJtaBegin(JtaTransactionObject txObject, TransactionDefinition definition)
|
||||
throws NotSupportedException, SystemException {
|
||||
|
||||
|
|
@ -211,6 +214,7 @@ public class OC4JJtaTransactionManager extends JtaTransactionManager {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Transaction createTransaction(String name, int timeout) throws NotSupportedException, SystemException {
|
||||
if (this.beginWithNameMethod != null && name != null) {
|
||||
UserTransaction ut = getUserTransaction();
|
||||
|
|
|
|||
|
|
@ -105,11 +105,13 @@ public class WebLogicJtaTransactionManager extends JtaTransactionManager {
|
|||
private Object transactionHelper;
|
||||
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws TransactionSystemException {
|
||||
super.afterPropertiesSet();
|
||||
loadWebLogicTransactionClasses();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected UserTransaction retrieveUserTransaction() throws TransactionSystemException {
|
||||
loadWebLogicTransactionHelperClass();
|
||||
try {
|
||||
|
|
@ -128,6 +130,7 @@ public class WebLogicJtaTransactionManager extends JtaTransactionManager {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TransactionManager retrieveTransactionManager() throws TransactionSystemException {
|
||||
loadWebLogicTransactionHelperClass();
|
||||
try {
|
||||
|
|
@ -229,6 +232,7 @@ public class WebLogicJtaTransactionManager extends JtaTransactionManager {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void doJtaBegin(JtaTransactionObject txObject, TransactionDefinition definition)
|
||||
throws NotSupportedException, SystemException {
|
||||
|
||||
|
|
@ -297,6 +301,7 @@ public class WebLogicJtaTransactionManager extends JtaTransactionManager {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doJtaResume(JtaTransactionObject txObject, Object suspendedTransaction)
|
||||
throws InvalidTransactionException, SystemException {
|
||||
|
||||
|
|
@ -332,6 +337,7 @@ public class WebLogicJtaTransactionManager extends JtaTransactionManager {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Transaction createTransaction(String name, int timeout) throws NotSupportedException, SystemException {
|
||||
if (this.weblogicUserTransactionAvailable && name != null) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -136,6 +136,7 @@ public class WebSphereUowTransactionManager extends JtaTransactionManager
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws TransactionSystemException {
|
||||
initUserTransactionAndTransactionManager();
|
||||
|
||||
|
|
@ -176,6 +177,7 @@ public class WebSphereUowTransactionManager extends JtaTransactionManager
|
|||
/**
|
||||
* Registers the synchronizations as interposed JTA Synchronization on the UOWManager.
|
||||
*/
|
||||
@Override
|
||||
protected void doRegisterAfterCompletionWithJtaTransaction(JtaTransactionObject txObject, List synchronizations) {
|
||||
this.uowManager.registerInterposedSynchronization(new JtaAfterCompletionSynchronization(synchronizations));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,6 +217,7 @@ public class DefaultTransactionDefinition implements TransactionDefinition, Seri
|
|||
* This implementation compares the <code>toString()</code> results.
|
||||
* @see #toString()
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
return (other instanceof TransactionDefinition && toString().equals(other.toString()));
|
||||
}
|
||||
|
|
@ -225,6 +226,7 @@ public class DefaultTransactionDefinition implements TransactionDefinition, Seri
|
|||
* This implementation returns <code>toString()</code>'s hash code.
|
||||
* @see #toString()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return toString().hashCode();
|
||||
}
|
||||
|
|
@ -241,6 +243,7 @@ public class DefaultTransactionDefinition implements TransactionDefinition, Seri
|
|||
* @see #getDefinitionDescription()
|
||||
* @see org.springframework.transaction.interceptor.TransactionAttributeEditor
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return getDefinitionDescription().toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,6 +150,7 @@ public class DefaultTransactionStatus extends AbstractTransactionStatus {
|
|||
* by the transaction coordinator, for example in case of a timeout.
|
||||
* @see SmartTransactionObject#isRollbackOnly
|
||||
*/
|
||||
@Override
|
||||
public boolean isGlobalRollbackOnly() {
|
||||
return ((this.transaction instanceof SmartTransactionObject) &&
|
||||
((SmartTransactionObject) this.transaction).isRollbackOnly());
|
||||
|
|
@ -159,6 +160,7 @@ public class DefaultTransactionStatus extends AbstractTransactionStatus {
|
|||
* This implementation exposes the SavepointManager interface
|
||||
* of the underlying transaction object, if any.
|
||||
*/
|
||||
@Override
|
||||
protected SavepointManager getSavepointManager() {
|
||||
if (!isTransactionSavepointManager()) {
|
||||
throw new NestedTransactionNotSupportedException(
|
||||
|
|
|
|||
Loading…
Reference in New Issue