|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.torque.dsfactory.AbstractDataSourceFactory org.apache.torque.dsfactory.JndiDataSourceFactory
public class JndiDataSourceFactory
A factory that looks up the DataSource from JNDI. It is also able to deploy the DataSource based on properties found in the configuration. This factory tries to avoid excessive context lookups to improve speed. The time between two lookups can be configured. The default is 0 (no cache).
Field Summary | |
---|---|
static java.lang.String |
CLASSNAME_KEY
Key for the configuration property which contains the class name of the datasource to be bound into jndi. |
static java.lang.String |
DATASOURCE_KEY
Key for the configuration which contains properties for a DataSource which should be bound into jndi. |
static java.lang.String |
JNDI_KEY
Key for the configuration which contains jndi properties. |
static java.lang.String |
PATH_KEY
Key for the configuration property which contains the jndi path. |
static java.lang.String |
TIME_BETWEEN_LOOKUPS_KEY
Key for the configuration property which contains the time between two jndi lookups. |
Fields inherited from class org.apache.torque.dsfactory.AbstractDataSourceFactory |
---|
CONNECTION_KEY, DEFAULT_CONNECTION_KEY, DEFAULT_POOL_KEY, DEFAULT_SCHEMA_KEY, DEFAULTS_KEY, POOL_KEY, SCHEMA_KEY |
Fields inherited from interface org.apache.torque.dsfactory.DataSourceFactory |
---|
DSFACTORY_KEY, FACTORY_KEY |
Constructor Summary | |
---|---|
JndiDataSourceFactory()
|
Method Summary | |
---|---|
void |
close()
Does nothing. |
javax.sql.DataSource |
getDataSource()
|
void |
initialize(org.apache.commons.configuration.Configuration configuration)
Initialize the factory. |
Methods inherited from class org.apache.torque.dsfactory.AbstractDataSourceFactory |
---|
applyConfiguration, getSchema, initCPDS, setProperty, setSchema |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String JNDI_KEY
public static final java.lang.String PATH_KEY
public static final java.lang.String TIME_BETWEEN_LOOKUPS_KEY
public static final java.lang.String DATASOURCE_KEY
public static final java.lang.String CLASSNAME_KEY
Constructor Detail |
---|
public JndiDataSourceFactory()
Method Detail |
---|
public javax.sql.DataSource getDataSource() throws TorqueException
getDataSource
in interface DataSourceFactory
getDataSource
in class AbstractDataSourceFactory
DataSource
configured by the factory.
TorqueException
- if the source can't be returnedDataSourceFactory.getDataSource()
public void initialize(org.apache.commons.configuration.Configuration configuration) throws TorqueException
AbstractDataSourceFactory
initialize
in interface DataSourceFactory
initialize
in class AbstractDataSourceFactory
configuration
- where to load the factory settings from
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.DataSourceFactory.initialize(org.apache.commons.configuration.Configuration)
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |