pt.ist.fenixframework.backend.mem
Class MemTransactionManager

Package class diagram package MemTransactionManager
java.lang.Object
  extended by pt.ist.fenixframework.core.AbstractTransactionManager
      extended by pt.ist.fenixframework.backend.mem.MemTransactionManager
All Implemented Interfaces:
TransactionManager

public class MemTransactionManager
extends AbstractTransactionManager


Constructor Summary
MemTransactionManager()
           
 
Method Summary
protected  void backendCommit()
           
protected  void backendRollback()
           
 void begin(boolean readOnly)
          Create a new transaction and associate it with the current thread.
 Transaction getTransaction()
          Get the Transaction object that represents the transaction context of the calling thread.
 void resume(Transaction tobj)
           
 void setTransactionTimeout(int seconds)
           
 Transaction suspend()
           
<T> T
withTransaction(Callable<T> command)
          Transactionally execute a command, possibly returning a result.
<T> T
withTransaction(Callable<T> command, Atomic atomic)
          Transactionally execute a command, possibly returning a result.
<T> T
withTransaction(CallableWithoutException<T> command)
          Transactionally execute a command, possibly returning a result.
 
Methods inherited from class pt.ist.fenixframework.core.AbstractTransactionManager
addCommitListener, begin, commit, getStatus, removeCommitListener, rollback, setRollbackOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemTransactionManager

public MemTransactionManager()
Method Detail

getTransaction

public Transaction getTransaction()
Description copied from interface: TransactionManager
Get the Transaction object that represents the transaction context of the calling thread. Subsequent calls to this method, while in the scope of a given transaction, will always return the same instance.


withTransaction

public <T> T withTransaction(CallableWithoutException<T> command)
Description copied from interface: TransactionManager
Transactionally execute a command, possibly returning a result. Implementations of this method normally invoke #withTransaction(Callable, Atomic) with a default atomic behaviour.

Parameters:
command - The command to execute.

withTransaction

public <T> T withTransaction(Callable<T> command)
                  throws Exception
Description copied from interface: TransactionManager
Transactionally execute a command, possibly returning a result. Implementations of this method normally invoke #withTransaction(Callable, Atomic) with a default atomic behaviour.

Parameters:
command - The command to execute.
Throws:
Exception

withTransaction

public <T> T withTransaction(Callable<T> command,
                             Atomic atomic)
                  throws Exception
Description copied from interface: TransactionManager
Transactionally execute a command, possibly returning a result.

Parameters:
command - The command to execute
atomic - the configuration for the execution of this command.
Throws:
Exception

begin

public void begin(boolean readOnly)
           throws NotSupportedException,
                  SystemException
Description copied from interface: TransactionManager
Create a new transaction and associate it with the current thread. This method can be used as a hint from the programmer that she does (or does not) intend do perform write operations. As such, implementations may optimize for the read-only case, and fail as soon as a write is attempted. However, if during the transaction the program attempts any write, and the transactional system is able to cope with the request, it may proceed without failing. In other words, write transactions are not guaranteed to rollback (i.e. they may commit) when invoking this method with true.

Throws:
NotSupportedException - Thrown if the thread is already associated with a transaction and the Transaction Manager implementation does not support nested transactions.
SystemException - Thrown if the transaction manager encounters an unexpected error condition that prevents future transaction services from proceeding.

resume

public void resume(Transaction tobj)
            throws InvalidTransactionException,
                   IllegalStateException,
                   SystemException
Throws:
InvalidTransactionException
IllegalStateException
SystemException

setTransactionTimeout

public void setTransactionTimeout(int seconds)
                           throws SystemException
Throws:
SystemException

suspend

public Transaction suspend()
                    throws SystemException
Throws:
SystemException

backendCommit

protected void backendCommit()
                      throws RollbackException,
                             HeuristicMixedException,
                             HeuristicRollbackException,
                             SecurityException,
                             IllegalStateException,
                             SystemException
Specified by:
backendCommit in class AbstractTransactionManager
Throws:
RollbackException
HeuristicMixedException
HeuristicRollbackException
SecurityException
IllegalStateException
SystemException

backendRollback

protected void backendRollback()
                        throws SecurityException,
                               SystemException
Specified by:
backendRollback in class AbstractTransactionManager
Throws:
SecurityException
SystemException


Copyright © 2013. All Rights Reserved.