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:
- Configurable, Contextualizable, DataSourceSelector, Disposable, Initializable, LogEnabled, ServiceSelector
- public class DefaultDataSourceSelector
- extends AbstractLogEnabled
- implements DataSourceSelector, Contextualizable, Configurable, Initializable, 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
- Component:
- name="data-source-selector" lifestyle="singleton"
- Service Export:
- type="org.apache.avalon.cornerstone.services.datasources.DataSourceSelector"
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(Context context)
throws ContextException
- Contextualization of the component by the container.
- Specified by:
contextualize
in interface Contextualizable
- Parameters:
context
- the supplied context object
- Throws:
ContextException
- Context Entry:
- key="urn:avalon:name" alias="block.name"
configure
public void configure(Configuration configuration)
- Specified by:
configure
in interface Configurable
- Configuration Schema:
- schema="relax-ng"
initialize
public void initialize()
throws Exception
- Specified by:
initialize
in interface Initializable
- Throws:
Exception
dispose
public void dispose()
- Specified by:
dispose
in interface Disposable
isSelectable
public boolean isSelectable(Object hint)
- Specified by:
isSelectable
in interface ServiceSelector
select
public Object select(Object hint)
throws ServiceException
- Specified by:
select
in interface ServiceSelector
- Throws:
ServiceException
release
public void release(Object component)
- Specified by:
release
in interface ServiceSelector
Copyright © Apache Software Foundation. All Rights Reserved.