com.xenonsoft.bridgetown.aop.transaction
Interface ITransactionServiceManager

All Known Implementing Classes:
AbstractTransactionServiceManager, MockTransactionServiceManager

public interface ITransactionServiceManager

A contract for a transaction management service that is associated with a lightweight container.

Version:
$Id: ITransactionServiceManager.java,v 1.4 2005/03/17 02:35:51 peter_pilgrim Exp $
Author:
peterp, 20-Nov-2004

Method Summary
 void addParticipiant(ITransactionParticipant participant)
          Registers a transaction participant for notification of transaction management events.
 void begin(ITransactionSession session, ITransactionConfig config)
          Causes the transaction manager to allocate a transaction object from a transaction session using the configuration attributes supplied.
 void commit()
          This method causes the transaction manager to commit the current transaction object.
 ITransactionContext getTransaction()
          Retrieves the current transaction exception, if it exists within the transaction manager
 boolean isActive()
          Returns a boolean value if the current global transaction currently active.
 boolean isTransactionNew(ITransactionContext txRef)
          Gets the boolean flag if the supplied transaction associated with this manager and with the current thread is a brand new creation or not.
 void removeParticipiant(ITransactionParticipant participant)
          Unregisters a transaction participant from notification of transaction management events.
 void resume(ITransactionContext txRef)
          Resumes the transaction context
 void rollback()
          This method causes the transaction manager to rollback the current transaction object.
 ITransactionContext suspend()
          Suspends the current transaction context
 

Method Detail

begin

public void begin(ITransactionSession session,
                  ITransactionConfig config)
           throws TransactionException
Causes the transaction manager to allocate a transaction object from a transaction session using the configuration attributes supplied. The transaction manager, then, also starts the transaction before returning.

Parameters:
session - the transaction session
config - the transaction configuration
Throws:
TransactionException - if there is a transaction operation failure
java.lang.IllegalArgumentException - Unknown transaction demarcation enumeration
See Also:
commit(), rollback()

getTransaction

public ITransactionContext getTransaction()
                                   throws TransactionException
Retrieves the current transaction exception, if it exists within the transaction manager

Returns:
the current transaction context
Throws:
TransactionException - if there is a transaction operation failure
See Also:
isActive()

suspend

public ITransactionContext suspend()
                            throws TransactionException
Suspends the current transaction context

Returns:
the current transaction object
Throws:
TransactionException - if there is a transaction operation failure

resume

public void resume(ITransactionContext txRef)
            throws TransactionException
Resumes the transaction context

Parameters:
txRef - the transaction context as a reference
Throws:
TransactionException - if there is a transaction operation failure
java.lang.IllegalArgumentException - if the transaction object does not belong to this transaction manager
java.lang.IllegalStateException - if the transaction object was never suspended in the first place

commit

public void commit()
            throws TransactionException
This method causes the transaction manager to commit the current transaction object.

Throws:
TransactionException - if there is a transaction operation failure

rollback

public void rollback()
              throws TransactionException
This method causes the transaction manager to rollback the current transaction object.

Throws:
TransactionException - if there is a transaction operation failure

addParticipiant

public void addParticipiant(ITransactionParticipant participant)
Registers a transaction participant for notification of transaction management events.

Parameters:
participant - the transaction participant

removeParticipiant

public void removeParticipiant(ITransactionParticipant participant)
Unregisters a transaction participant from notification of transaction management events.

Parameters:
participant - the transaction participant

isActive

public boolean isActive()
Returns a boolean value if the current global transaction currently active.

The transaction is not active if it is one of the following states:

Returns:
the active state
See Also:
TransactionStateEnum

isTransactionNew

public boolean isTransactionNew(ITransactionContext txRef)
                         throws TransactionException,
                                java.lang.IllegalArgumentException
Gets the boolean flag if the supplied transaction associated with this manager and with the current thread is a brand new creation or not.

Parameters:
txRef - the reference transaction context
Returns:
boolean true if the current transaction is new.
Throws:
TransactionException - thrown if there is a transaction operation failure
java.lang.IllegalArgumentException - thrown if the transaction is not associated with this service manager.
See Also:
ITransactionContext.isTransactionNew()


Copyright © 2005 XeNoNSoFT.com. All Rights Reserved.