|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||

java.lang.Objecttoolbox.dao.AbstractDaoManager
public abstract class AbstractDaoManager
Abstract DaoManager that provides convenience methods when implementing the DaoManager interface.
The following functionality is provided:
| Field Summary | |
|---|---|
protected java.util.Map |
m_statements
Hashtable containing table names as keys and arrays of SQL Strings as values. |
protected java.util.Map |
m_tableDefs
Hashtable containing table names as keys and TableDefinition objects as values. |
protected XMLProperties |
m_xmlProps
XML configuration properties |
| Constructor Summary | |
|---|---|
protected |
AbstractDaoManager()
Protected constructor to ensure this class cannot be instantiated. |
| Method Summary | |
|---|---|
void |
destroy()
Destroy this manager by destroying the member resource pool. |
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 the configured worker implementation |
ListBuilder |
getListBuilder()
Instantiates and returns an instance of the configured ListBuilder implementation |
java.lang.String |
getName()
Return the name of this manager |
protected void |
initFinal()
Method to be called to initialise worker and list builder instances. |
protected void |
initSQL()
Creates SQL strings from the initialised TableDefinitions and stores them in the m_statements Map. |
protected void |
initStart(XMLProperties xmlProps)
Initialises all internal resources for this manager. |
TransactionContext |
newTransactionContext()
Instantiates and returns an instance of the configured context implementation |
void |
releaseConnection(java.sql.Connection connection)
Release a connection. |
void |
setName(java.lang.String name)
Set the name of this manager. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface toolbox.dao.DaoManager |
|---|
init |
| Field Detail |
|---|
protected java.util.Map m_tableDefs
protected java.util.Map m_statements
protected XMLProperties m_xmlProps
| Constructor Detail |
|---|
protected AbstractDaoManager()
| Method Detail |
|---|
protected void initStart(XMLProperties xmlProps)
throws DaoException
The following is initialised:
DaoException - if internal settings cannot be set.protected void initSQL()
A String array is created for each initialised TableDefinition. The array contains five SQL strings:
protected void initFinal()
throws DaoException
DaoException - if the instances cannot be created.public void setName(java.lang.String name)
setName in interface DaoManagername - String containing manager name.public java.lang.String getName()
getName in interface DaoManager
public java.sql.Connection getConnection()
throws DaoException
getConnection in interface DaoManagerDaoException - if a connection cannot be obtained.public void releaseConnection(java.sql.Connection connection)
releaseConnection in interface DaoManagerconnection - Connection to releasepublic DaoWorker getDaoWorker()
getDaoWorker in interface DaoManager
public TransactionContext newTransactionContext()
throws DaoException
newTransactionContext in interface DaoManagerDaoException - if the context cannot be instantiated.public ListBuilder getListBuilder()
getListBuilder in interface DaoManager
public void freeResources(TransactionContext tc)
throws DaoException
freeResources in interface DaoManagertc - TransactionContext.
DaoException - if resources cannot be released from the context.
public void destroy()
throws DaoException
destroy in interface DaoManagerDaoException - if the pool cannot be destroyed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||