码迷,mamicode.com
首页 > 其他好文 > 详细

DefaultTransactionStatus源码

时间:2014-05-08 23:47:26      阅读:434      评论:0      收藏:0      [点我收藏+]

标签:style   blog   class   code   java   ext   

bubuko.com,布布扣
package org.springframework.transaction.support;

import org.springframework.transaction.NestedTransactionNotSupportedException;
import org.springframework.transaction.SavepointManager;

public class DefaultTransactionStatus extends AbstractTransactionStatus
{
  private final Object transaction;
  private final boolean newTransaction;
  private final boolean newSynchronization;
  private final boolean readOnly;
  private final boolean debug;
  private final Object suspendedResources;

  public DefaultTransactionStatus(Object transaction, boolean newTransaction, 
      boolean newSynchronization, boolean readOnly, boolean debug, Object suspendedResources) { this.transaction = transaction; this.newTransaction = newTransaction; this.newSynchronization = newSynchronization; this.readOnly = readOnly; this.debug = debug; this.suspendedResources = suspendedResources; } public Object getTransaction() { return this.transaction; } public boolean hasTransaction() { return this.transaction != null; } public boolean isNewTransaction() { return (hasTransaction()) && (this.newTransaction); } public boolean isNewSynchronization() { return this.newSynchronization; } public boolean isReadOnly() { return this.readOnly; } public boolean isDebug() { return this.debug; } public Object getSuspendedResources() { return this.suspendedResources; } public boolean isGlobalRollbackOnly() { return ((this.transaction instanceof SmartTransactionObject)) && (((SmartTransactionObject)this.transaction).isRollbackOnly()); } protected SavepointManager getSavepointManager() { if (!isTransactionSavepointManager()) { throw new NestedTransactionNotSupportedException("Transaction object [" + getTransaction() + "] does not support savepoints"); } return (SavepointManager)getTransaction(); } public boolean isTransactionSavepointManager() { return getTransaction() instanceof SavepointManager; } }
bubuko.com,布布扣

 

DefaultTransactionStatus源码,布布扣,bubuko.com

DefaultTransactionStatus源码

标签:style   blog   class   code   java   ext   

原文地址:http://www.cnblogs.com/shaohz2014/p/3716633.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!