org.jadetower.dao.impl
Class DefaultDaoManager

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.jadetower.dao.impl.DefaultDaoManager
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, DaoManager, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable

public class DefaultDaoManager
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements DaoManager, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.context.Contextualizable

The Default DAO Manager. Handles Bean, Pico, and Avalon lifecycles. Uses a PicoContainer as the basic internal DAO container. Part of this class was taken from org.apache.excalibur.configuration.ContextFactory and is copyrighted by the Apache Software Foundation


Field Summary
 
Fields inherited from interface org.jadetower.dao.DaoManager
ROLE
 
Constructor Summary
DefaultDaoManager()
           
DefaultDaoManager(Resolver resolver, org.apache.avalon.framework.logger.Logger logger, org.apache.avalon.framework.configuration.Configuration config, java.util.Map context)
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
 void contextualize(org.apache.avalon.framework.context.Context context)
           
protected  java.util.Map createContextFromConfiguration(org.apache.avalon.framework.context.Context parent, org.apache.avalon.framework.configuration.Configuration config, org.apache.avalon.framework.logger.Logger log)
          Create context-attributes from entrys within <context/>-tag in config (Copyright ASF).
 java.lang.Object getDao(java.lang.String name)
          returns the DAO for this Name
protected  void handleInstanceLifecycle(java.lang.String name, java.lang.Object dao)
           
protected  void handleProxyLifecycle(java.lang.Object dao)
           
protected  void handleStartup(java.lang.Object proxy)
           
 void initialize()
           
protected  void registerDAO(java.lang.String name, java.lang.Object dao)
           
 void release(java.lang.Object object)
          released the DAO
 void service(org.apache.avalon.framework.service.ServiceManager serviceManager)
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDaoManager

public DefaultDaoManager()

DefaultDaoManager

public DefaultDaoManager(Resolver resolver,
                         org.apache.avalon.framework.logger.Logger logger,
                         org.apache.avalon.framework.configuration.Configuration config,
                         java.util.Map context)
                  throws java.lang.InstantiationException
Method Detail

getDao

public java.lang.Object getDao(java.lang.String name)
                        throws DaoException
Description copied from interface: DaoManager
returns the DAO for this Name

Specified by:
getDao in interface DaoManager
Throws:
DaoException

release

public void release(java.lang.Object object)
Description copied from interface: DaoManager
released the DAO

Specified by:
release in interface DaoManager
Parameters:
object - DAO Object

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable

service

public void service(org.apache.avalon.framework.service.ServiceManager serviceManager)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable
Throws:
java.lang.Exception

registerDAO

protected void registerDAO(java.lang.String name,
                           java.lang.Object dao)
                    throws java.lang.Exception
Throws:
java.lang.Exception

handleProxyLifecycle

protected void handleProxyLifecycle(java.lang.Object dao)
                             throws java.lang.Exception
Throws:
java.lang.Exception

handleInstanceLifecycle

protected void handleInstanceLifecycle(java.lang.String name,
                                       java.lang.Object dao)
                                throws java.lang.Exception
Throws:
java.lang.Exception

handleStartup

protected void handleStartup(java.lang.Object proxy)
                      throws java.lang.Exception
Throws:
java.lang.Exception

createContextFromConfiguration

protected java.util.Map createContextFromConfiguration(org.apache.avalon.framework.context.Context parent,
                                                       org.apache.avalon.framework.configuration.Configuration config,
                                                       org.apache.avalon.framework.logger.Logger log)
                                                throws org.apache.avalon.framework.configuration.ConfigurationException
Create context-attributes from entrys within <context/>-tag in config (Copyright ASF). Modified to handle URI's instead of types.

Parameters:
parent - the parent context
config - the configuration element describing the context parameters
log - a logging channel
Returns:
Context a context instance
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - if a context related error occurs


Copyright © 2003-2004 JadeTower. All Rights Reserved.