org.slim3.transaction.websphere
Class WebSphereTransactionController

java.lang.Object
  extended by org.slim3.transaction.controller.AbstractTransactionController
      extended by org.slim3.transaction.websphere.WebSphereTransactionController
All Implemented Interfaces:
TransactionController

public class WebSphereTransactionController
extends AbstractTransactionController

An implementation class for TransactionController using WebSphere UOWManager.

Since:
3.0
Author:
koichik, higa

Nested Class Summary
protected  class WebSphereTransactionController.UOWActionImpl
          An implementation class for UOWAction.
 
Field Summary
protected  com.ibm.wsspi.uow.UOWManager uowManager
          The UOWManager.
 
Constructor Summary
WebSphereTransactionController(com.ibm.wsspi.uow.UOWManager uowManager)
          Constructor.
 
Method Summary
protected  boolean hasTransaction()
          Returns true if the current thread has a transaction.
 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.
protected  Object runUnderUOW(int transactionType, boolean joinTransaction, TransactionAction action)
          Runs the action under UOWManager.
 void setRollbackOnly()
          Modify the transaction such that the transaction is rolled back.
 
Methods inherited from class org.slim3.transaction.controller.AbstractTransactionController
execute, mandatory, never
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uowManager

protected final com.ibm.wsspi.uow.UOWManager uowManager
The UOWManager.

Constructor Detail

WebSphereTransactionController

public WebSphereTransactionController(com.ibm.wsspi.uow.UOWManager uowManager)
                               throws NullPointerException
Constructor.

Parameters:
uowManager - the UOWManager
Throws:
NullPointerException - if the uowManager parameter is null
Method Detail

required

public Object required(TransactionAction action)
                throws Exception
Description copied from interface: TransactionController
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

public Object requiresNew(TransactionAction action)
                   throws Exception
Description copied from interface: TransactionController
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

notSupported

public Object notSupported(TransactionAction action)
                    throws Exception
Description copied from interface: TransactionController
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

setRollbackOnly

public void setRollbackOnly()
Description copied from interface: TransactionController
Modify the transaction such that the transaction is rolled back.


runUnderUOW

protected Object runUnderUOW(int transactionType,
                             boolean joinTransaction,
                             TransactionAction action)
                      throws Exception
Runs the action under UOWManager.

Parameters:
transactionType - the transaction type
joinTransaction - whether the client joins a transaction
action - the action
Returns:
a result which action returns
Throws:
Exception - if an exception is encountered

hasTransaction

protected boolean hasTransaction()
Description copied from class: AbstractTransactionController
Returns true if the current thread has a transaction.

Specified by:
hasTransaction in class AbstractTransactionController
Returns:
whether the current thread has a transaction
See Also:
UserTransaction.getStatus()


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