org.apache.avalon.cornerstone.blocks.datasources
Class DefaultDataSourceSelector
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.avalon.cornerstone.blocks.datasources.DefaultDataSourceSelector
- All Implemented Interfaces:
- org.apache.avalon.cornerstone.services.datasources.DataSourceSelector, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.ServiceSelector
public class DefaultDataSourceSelector
- extends org.apache.avalon.framework.logger.AbstractLogEnabled
- implements org.apache.avalon.cornerstone.services.datasources.DataSourceSelector, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.activity.Disposable
A default implementation for DataSourceSelector.
The Configuration is like this:
<myBlock>
<data-source name="default"
class="org.apache.avalon.excalibur.datasource.JdbcDataSource">
<!-- configuration for JdbcDataSource -->
<pool-controller min="5" max="10" connection-class="my.overrided.ConnectionClass">
<keep-alive>select 1</keep-alive>
</pool-controller>
<driver>com.database.jdbc.JdbcDriver</driver>
<dburl>jdbc:driver://host/mydb</dburl>
<user>username</user>
<password>password</password>
</data-source>
</myBlock>
- Author:
- Avalon Development Team
Fields inherited from interface org.apache.avalon.cornerstone.services.datasources.DataSourceSelector |
ROLE |
Method Summary |
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
|
void |
contextualize(org.apache.avalon.framework.context.Context context)
Contextualization of the component by the container. |
void |
dispose()
|
void |
initialize()
|
boolean |
isSelectable(java.lang.Object hint)
|
void |
release(java.lang.Object component)
|
java.lang.Object |
select(java.lang.Object hint)
|
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 |
DefaultDataSourceSelector
public DefaultDataSourceSelector()
contextualize
public void contextualize(org.apache.avalon.framework.context.Context context)
throws org.apache.avalon.framework.context.ContextException
- Contextualization of the component by the container.
- Specified by:
contextualize
in interface org.apache.avalon.framework.context.Contextualizable
- Parameters:
context
- the supplied context object
- Throws:
org.apache.avalon.framework.context.ContextException
configure
public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
- Specified by:
configure
in interface org.apache.avalon.framework.configuration.Configurable
initialize
public void initialize()
throws java.lang.Exception
- Specified by:
initialize
in interface org.apache.avalon.framework.activity.Initializable
- Throws:
java.lang.Exception
dispose
public void dispose()
- Specified by:
dispose
in interface org.apache.avalon.framework.activity.Disposable
isSelectable
public boolean isSelectable(java.lang.Object hint)
- Specified by:
isSelectable
in interface org.apache.avalon.framework.service.ServiceSelector
select
public java.lang.Object select(java.lang.Object hint)
throws org.apache.avalon.framework.service.ServiceException
- Specified by:
select
in interface org.apache.avalon.framework.service.ServiceSelector
- Throws:
org.apache.avalon.framework.service.ServiceException
release
public void release(java.lang.Object component)
- Specified by:
release
in interface org.apache.avalon.framework.service.ServiceSelector
Copyright © 2008 Apache Software Foundation. All Rights Reserved.