org.slim3.transaction.controller
Interface TransactionController

All Known Implementing Classes:
AbstractTransactionController, JtaTransactionController, WebSphereTransactionController

public interface TransactionController

An interface to control transaction.

Since:
3.0
Author:
koichik, higa

Method Summary
 Object mandatory(TransactionAction callback)
          Executes the action within a transaction.
 Object never(TransactionAction action)
          If the client is associated with a transaction, the controller throws a RemoteException.
 Object notSupported(TransactionAction action)
          Executes the action within a transaction.
 Object required(TransactionAction action)
          Executes the action within a transaction.
 Object requiresNew(TransactionAction action)
          Executes the action within a transaction.
 void setRollbackOnly()
          Modify the transaction such that the transaction is rolled back.
 

Method Detail

required

Object required(TransactionAction action)
                throws NotSupportedException,
                       Exception
Executes the action within a transaction. If the client is not associated with a transaction, the controller starts a new transaction before execute the action.

Parameters:
action - the action
Returns:
a result which the action returns
Throws:
NotSupportedException - if nested transaction is not supported
Exception - if an exception is encountered

requiresNew

Object requiresNew(TransactionAction action)
                   throws Exception
Executes the action within a transaction. Even if the client is associated with a transaction or not, the controller starts a new transaction before executing the action.

Parameters:
action - the action
Returns:
a result which the action returns
Throws:
Exception - if an exception is encountered

mandatory

Object mandatory(TransactionAction callback)
                 throws TransactionRequiredException,
                        Exception
Executes the action within a transaction. If the client is not associated with a transaction, the controller throws the TransactionRequiredException.

Parameters:
callback - the called back action
Returns:
a result which the action returns
Throws:
TransactionRequiredException - if the client is not associated with a transaction
Exception - if an exception is encountered

notSupported

Object notSupported(TransactionAction action)
                    throws Exception
Executes the action within a transaction. If the client is not associated with a transaction, the controller suspends the client’s transaction before executing the action. After the action has completed, the controller resumes the client’s transaction. If the client is not associated with a transaction, the controller does not start a new transaction.

Parameters:
action - the action
Returns:
a result which the action returns
Throws:
Exception - if an exception is encountered

never

Object never(TransactionAction action)
             throws RemoteException,
                    Exception
If the client is associated with a transaction, the controller throws a RemoteException. If the client is not associated with a transaction, the controller does not start a new transaction before executing the action.

Parameters:
action - the action
Returns:
a result which the action returns
Throws:
RemoteException - if the client is associated with a transaction
Exception - if an exception is encountered

setRollbackOnly

void setRollbackOnly()
Modify the transaction such that the transaction is rolled back.



Copyright © 2008-2009 The Slim3 project. All Rights Reserved.