com.boylesoftware.cb2
Class DAOConfig

java.lang.Object
  extended bycom.boylesoftware.cb2.DAOConfig

public final class DAOConfig
extends java.lang.Object

DAO configuration built from a <dao-config> element in the blo-config.xml file. A DAOConfig object is required to create any instance of DAO. Multiple DAO instances can share the same DAO configuration object. The reason behind separating DAO configuration from the DAO itself, is that parsing a <dao-config> element and bulding a DAOConfig object out of it is a very expensive operation, so having a separate object allows to perform it once and then quickly create DAO instances on its basis.

The BL Manager, being initialized, creates and then keeps instances of DAOConfig for each configured data source. References to those objects can be retrieved from within any BLO via its getDAOConfig protected method.

The DAOConfig logs messages related to its operation under "com.boylesoftware.cb2.DAOCFG" log channel.

Version:
$Id: DAOConfig.java,v 1.9 2004/05/12 15:41:17 levahim Exp $
Author:
Lev Himmelfarb

Constructor Summary
DAOConfig(ApplicationContext appCtx, java.lang.String dataSourceName, org.w3c.dom.Element[] daoConfigs)
          Constructs a DAO config instance from a number of <dao-config> XML elements.
 
Method Summary
 ApplicationContext getApplicationContext()
          Gets the application context associated with this config object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DAOConfig

public DAOConfig(ApplicationContext appCtx,
                 java.lang.String dataSourceName,
                 org.w3c.dom.Element[] daoConfigs)
          throws BLException
Constructs a DAO config instance from a number of <dao-config> XML elements. Contents of the specified <dao-config> elements are combined together and threated as one.

Parameters:
appCtx - the application context.
dataSourceName - logical name of the data source, for which this config is built. Any dataSource attributes of the specified <dao-config> elements are ignored.
daoConfigs - array of parsed <dao-config> XML elements.
Throws:
BLException - if an error happens preventing the DAO config from being built.
Method Detail

getApplicationContext

public ApplicationContext getApplicationContext()
Gets the application context associated with this config object.

Returns:
reference to the application context.


Copyright © 2002,2003,2004 - Boyle Software, Inc.