org.acmsl.queryj.dao
Class DataSourceTransactionToken

java.lang.Object
  |
  +--org.acmsl.queryj.dao.DataSourceTransactionToken
All Implemented Interfaces:
TransactionToken

public abstract class DataSourceTransactionToken
extends java.lang.Object
implements TransactionToken

JDBC-related Transaction Token using DataSource class.

Version:
$Revision: 1.1 $
Author:
Jose San Leandro Armend?riz

Constructor Summary
DataSourceTransactionToken(javax.sql.DataSource dataSource)
          Creates a DataSourceTransactionToken using given connection.
 
Method Summary
 void beginTransaction()
          Gets notified whenever the transaction starts.
 void endTransaction()
          Takes into account that the transaction is over.
 boolean equals(java.lang.Object object)
          Checks if this object is logically equal to given one.
 javax.sql.DataSource getDataSource()
          Retrieves the data source.
 boolean isNotYetReleased()
          Checks if the transaction has been released.
 boolean isRollbackPending()
          Checks the need for a rollback of the whole transaction.
 boolean isTransactionAlive()
          Checks if the transaction is alive.
 void release()
          Releases the transaction.
protected  void setDataSource(javax.sql.DataSource dataSource)
          Specifies the data source.
protected  void setNotYetReleased(boolean releaseState)
          Specifies if the transaction has been released.
 void setRollbackPending(boolean flag)
          Sets the need for a rollback of the whole transaction.
protected  void setTransactionAlive(boolean alive)
          Checks if the transaction is alive.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceTransactionToken

public DataSourceTransactionToken(javax.sql.DataSource dataSource)
Creates a DataSourceTransactionToken using given connection.

Parameters:
dataSource - the data source to use inside the whole transaction.
Method Detail

setDataSource

protected void setDataSource(javax.sql.DataSource dataSource)
Specifies the data source.

Parameters:
dataSource - the connection to use inside the whole transaction.

getDataSource

public javax.sql.DataSource getDataSource()
Retrieves the data source.

Returns:
the data source used inside the whole transaction.

equals

public boolean equals(java.lang.Object object)
Checks if this object is logically equal to given one.

Overrides:
equals in class java.lang.Object
Parameters:
object - the object to compare to.
Returns:
true if both objects are equal logically.

isTransactionAlive

public boolean isTransactionAlive()
Checks if the transaction is alive.

Specified by:
isTransactionAlive in interface TransactionToken
Returns:
true if so.

setTransactionAlive

protected void setTransactionAlive(boolean alive)
Checks if the transaction is alive.

Returns:
true if so.

isNotYetReleased

public boolean isNotYetReleased()
Checks if the transaction has been released.

Returns:
false if so.

setNotYetReleased

protected void setNotYetReleased(boolean releaseState)
Specifies if the transaction has been released.

Parameters:
releaseState - the release state.

beginTransaction

public void beginTransaction()
Gets notified whenever the transaction starts.

Specified by:
beginTransaction in interface TransactionToken

endTransaction

public void endTransaction()
Takes into account that the transaction is over.

Specified by:
endTransaction in interface TransactionToken

release

public void release()
Releases the transaction.

Specified by:
release in interface TransactionToken

setRollbackPending

public void setRollbackPending(boolean flag)
Sets the need for a rollback of the whole transaction.

Specified by:
setRollbackPending in interface TransactionToken
Parameters:
flag - to indicate to rollback the transaction.

isRollbackPending

public boolean isRollbackPending()
Checks the need for a rollback of the whole transaction.

Specified by:
isRollbackPending in interface TransactionToken
Returns:
such information.


Copyright © 2003 ACM S.L.. All Rights Reserved.