Added tests to AgentTest and cleaned up Agent

This commit is contained in:
Jonas Bonér 2010-03-20 09:49:59 +01:00
parent 79bfc4e446
commit fba843e02d
7 changed files with 187 additions and 116 deletions

View file

@ -6,8 +6,6 @@ package se.scalablesolutions.akka.stm
import java.util.concurrent.atomic.AtomicBoolean
import se.scalablesolutions.akka.util.Logging
import org.multiverse.api.ThreadLocalTransaction._
import org.multiverse.commitbarriers.CountDownCommitBarrier
@ -40,8 +38,8 @@ object TransactionManagement extends TransactionManagement {
private[akka] def getTransactionSet: CountDownCommitBarrier = {
val option = transactionSet.get
if ((option eq null) || option.isEmpty) throw new IllegalStateException("No TransactionSet in scope")
option.get
if ((option eq null) || option.isEmpty) throw new IllegalStateException("No Transaction set in scope")
else option.get
}
private[akka] def getTransaction: Transaction = {
@ -51,7 +49,7 @@ object TransactionManagement extends TransactionManagement {
}
}
trait TransactionManagement extends Logging {
trait TransactionManagement {
private[akka] def createNewTransactionSet: CountDownCommitBarrier = {
val txSet = new CountDownCommitBarrier(1, TransactionManagement.FAIR_TRANSACTIONS)