toolbox.dao
Interface DaoManager

Package class diagram package DaoManager
All Known Implementing Classes:
AbstractDaoManager, GenericDaoManager, MySQLDaoManager, NoDictDaoManager

public interface DaoManager

Defines an interface for developing a Data Access Object manager.

Implementations of this interface will provide the following services:

  • Generate common SQL queries from a configured data dicationary.
  • Provide access to pooled connection resources.
  • Manage the instantiation of DaoWorker instances.
  • Manage the instantiation of TransactionContext instances
  • Manage the instantiation of ListBuilder instances
  • Ensures that transaction resources are released.

  • Method Summary
     void destroy()
              Destroy this manager.
     void freeResources(TransactionContext tc)
              Free the resources held by the given transaction context.
     java.sql.Connection getConnection()
              Returns a reference to a pooled connection.
     DaoWorker getDaoWorker()
              Returns a reference to the DaoWorker instance of this manager.
     ListBuilder getListBuilder()
              Returns a reference to the ListBuilder of this manager.
     java.lang.String getName()
              Return the name of this manager.
     void init(XMLProperties xmlProps)
              Initialise the manager with XML configuration containing the definition of the data dictionary that is abstracted and the physical database configuration parameters.
     TransactionContext newTransactionContext()
              Instantiates and returns a TransactionContext instance.
     void releaseConnection(java.sql.Connection connection)
              Release a connection.
     void setName(java.lang.String name)
              Set the name of this manager.
     

    Method Detail

    init

    void init(XMLProperties xmlProps)
              throws DaoException
    Initialise the manager with XML configuration containing the definition of the data dictionary that is abstracted and the physical database configuration parameters.

    Parameters:
    xmlProps - XML configuration.
    Throws:
    DaoException - if the manager cannot be initialised.

    setName

    void setName(java.lang.String name)
    Set the name of this manager.

    Parameters:
    name - String containing manager name.

    getName

    java.lang.String getName()
    Return the name of this manager.

    Returns:
    String containing the name of this manager.

    getConnection

    java.sql.Connection getConnection()
                                      throws DaoException
    Returns a reference to a pooled connection.

    Returns:
    A managed connection.
    Throws:
    DaoException - if a connection cannot be obtained.

    releaseConnection

    void releaseConnection(java.sql.Connection connection)
    Release a connection.

    Parameters:
    connection - Connection to release

    getDaoWorker

    DaoWorker getDaoWorker()
    Returns a reference to the DaoWorker instance of this manager.

    Returns:
    DaoWorker instance.

    newTransactionContext

    TransactionContext newTransactionContext()
                                             throws DaoException
    Instantiates and returns a TransactionContext instance.

    Returns:
    TransactionContext instance.
    Throws:
    DaoException - if the context instance cannot be returned.

    getListBuilder

    ListBuilder getListBuilder()
    Returns a reference to the ListBuilder of this manager.

    Returns:
    ListBuilder instance.

    freeResources

    void freeResources(TransactionContext tc)
                       throws DaoException
    Free the resources held by the given transaction context.

    Parameters:
    tc - Free resources held by this transacation context.
    Throws:
    DaoException - if the resources held by the context cannot be released.

    destroy

    void destroy()
                 throws DaoException
    Destroy this manager.

    Throws:
    DaoException