org.acmsl.queryj.dao
Class TransactionTokenFactory

java.lang.Object
  |
  +--org.acmsl.queryj.dao.TransactionTokenFactory

public abstract class TransactionTokenFactory
extends java.lang.Object

Has the responsibility of creating transaction tokens. Right now, it follows the FactoryMethod pattern, but could be refactored as an abstract factory as new technologies are supported.

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

Constructor Summary
protected TransactionTokenFactory()
          Protected constructor to avoid accidental instantiation.
 
Method Summary
static DataSourceTransactionToken createTransactionToken(javax.sql.DataSource dataSource)
          Creates a SingleConnectionTransactionToken using given connection.
static TransactionTokenFactory getInstance()
          Retrieves a TransactionTokenFactory instance.
protected static java.lang.ref.WeakReference getReference()
          Retrieves the weak reference.
protected static void setReference(TransactionTokenFactory factory)
          Specifies a new weak reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionTokenFactory

protected TransactionTokenFactory()
Protected constructor to avoid accidental instantiation.

Method Detail

setReference

protected static void setReference(TransactionTokenFactory factory)
Specifies a new weak reference.

Parameters:
factory - the factory instance to use.

getReference

protected static java.lang.ref.WeakReference getReference()
Retrieves the weak reference.

Returns:
such reference.

getInstance

public static TransactionTokenFactory getInstance()
Retrieves a TransactionTokenFactory instance.

Returns:
such instance.

createTransactionToken

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

Parameters:
dataSource - the data source to use inside the same transaction.
Returns:
the transaction token, or null if the connection is invalid.


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