vishnu.model.transactions
Class TransactionImpl

java.lang.Object
  extended by vishnu.model.transactions.TransactionImpl
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, Transaction

public final class TransactionImpl
extends java.lang.Object
implements Transaction

Author:
Mariano Tepper and Hernan Rancati
See Also:
Serialized Form
 

Constructor Summary
TransactionImpl(TransactionTerminator c, UserContext userContext)
           
 
Method Summary
 void abort()
          Aborta la transaccion.
 void addOperation(Operation o)
           
 void commit()
          Commitea la transaccion
 UserContext getUserContext()
           
 boolean isAborted()
          Indica si la transaccion fue abortada.
 boolean isCommited()
          Indica si la transaccion fue commiteada.
 boolean isFinished()
          tells whether this transactions has nothing more to do.
 boolean isRunning()
          tells whether this transactions is doing something or has things to do.
 java.util.List<Operation> operationsDone()
          returns the sequence of operations that have been already done.
 void readExternal(java.io.ObjectInput arg0)
           
 java.util.Collection<Shareable> resourcesTakenForRead()
          returns the resources that are actually in use by the transaction in read mode.
 java.util.Collection<Shareable> resourcesTakenForWrite()
          returns the resources that are actually in use by the transaction in write mode.
 java.util.Collection<Shareable> resourcesWaitingForRead()
          returns the resources that are actually waited by the transaction in read mode.
 java.util.Collection<Shareable> resourcesWaitingForWrite()
          returns the resources that are actually waited by the transaction in write mode.
 void writeExternal(java.io.ObjectOutput arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionImpl

public TransactionImpl(TransactionTerminator c,
                       UserContext userContext)
Method Detail

abort

public void abort()
Description copied from interface: Transaction
Aborta la transaccion.

Specified by:
abort in interface Transaction

isAborted

public boolean isAborted()
Description copied from interface: Transaction
Indica si la transaccion fue abortada.

Specified by:
isAborted in interface Transaction
Returns:
true si la transaccion fue abortada, false si no.

commit

public void commit()
Description copied from interface: Transaction
Commitea la transaccion

Specified by:
commit in interface Transaction

isCommited

public boolean isCommited()
Description copied from interface: Transaction
Indica si la transaccion fue commiteada.

Specified by:
isCommited in interface Transaction
Returns:
true si la transaccion fue commiteada, false si no.

isFinished

public boolean isFinished()
Description copied from interface: Transaction
tells whether this transactions has nothing more to do.

Specified by:
isFinished in interface Transaction

isRunning

public boolean isRunning()
Description copied from interface: Transaction
tells whether this transactions is doing something or has things to do.

Specified by:
isRunning in interface Transaction

resourcesTakenForRead

public java.util.Collection<Shareable> resourcesTakenForRead()
Description copied from interface: Transaction
returns the resources that are actually in use by the transaction in read mode.

Specified by:
resourcesTakenForRead in interface Transaction

resourcesWaitingForRead

public java.util.Collection<Shareable> resourcesWaitingForRead()
Description copied from interface: Transaction
returns the resources that are actually waited by the transaction in read mode.

Specified by:
resourcesWaitingForRead in interface Transaction

resourcesTakenForWrite

public java.util.Collection<Shareable> resourcesTakenForWrite()
Description copied from interface: Transaction
returns the resources that are actually in use by the transaction in write mode.

Specified by:
resourcesTakenForWrite in interface Transaction

resourcesWaitingForWrite

public java.util.Collection<Shareable> resourcesWaitingForWrite()
Description copied from interface: Transaction
returns the resources that are actually waited by the transaction in write mode.

Specified by:
resourcesWaitingForWrite in interface Transaction

operationsDone

public java.util.List<Operation> operationsDone()
Description copied from interface: Transaction
returns the sequence of operations that have been already done.

Specified by:
operationsDone in interface Transaction

addOperation

public void addOperation(Operation o)
Specified by:
addOperation in interface Transaction

getUserContext

public UserContext getUserContext()
Specified by:
getUserContext in interface Transaction

writeExternal

public void writeExternal(java.io.ObjectOutput arg0)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput arg0)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException