|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.torque.dsfactory.AbstractDataSourceFactory
org.apache.torque.dsfactory.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.
Field Summary | |
private javax.naming.Context |
ctx
The context to get the resource from. |
private static org.apache.commons.logging.Log |
log
The log. |
private java.lang.String |
path
The path to get the resource from. |
Fields inherited from class org.apache.torque.dsfactory.AbstractDataSourceFactory |
CONNECTION_KEY, DEFAULT_CONNECTION_KEY, DEFAULT_POOL_KEY, POOL_KEY |
Constructor Summary | |
JndiDataSourceFactory()
|
Method Summary | |
private void |
bindDStoJndi(javax.naming.Context ctx,
java.lang.String path,
java.lang.Object ds)
|
private void |
debugCtx(javax.naming.Context ctx)
|
javax.sql.DataSource |
getDataSource()
|
private void |
initDataSource(org.apache.commons.configuration.Configuration configuration)
Initializes the DataSource. |
void |
initialize(org.apache.commons.configuration.Configuration configuration)
Initialize the factory. |
private void |
initJNDI(org.apache.commons.configuration.Configuration configuration)
Initializes JNDI. |
Methods inherited from class org.apache.torque.dsfactory.AbstractDataSourceFactory |
applyConfiguration, initCPDS, setProperty |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static org.apache.commons.logging.Log log
private java.lang.String path
private javax.naming.Context ctx
Constructor Detail |
public JndiDataSourceFactory()
Method Detail |
public javax.sql.DataSource getDataSource() throws TorqueException
getDataSource
in interface DataSourceFactory
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
DataSourceFactory
initialize
in interface DataSourceFactory
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)
private void initJNDI(org.apache.commons.configuration.Configuration configuration) throws TorqueException
configuration
- where to read the settings from
TorqueException
- if a property set failsprivate void initDataSource(org.apache.commons.configuration.Configuration configuration) throws TorqueException
configuration
- where to read the settings from
TorqueException
- if a property set failsprivate void debugCtx(javax.naming.Context ctx) throws javax.naming.NamingException
ctx
- the context
javax.naming.NamingException
private void bindDStoJndi(javax.naming.Context ctx, java.lang.String path, java.lang.Object ds) throws java.lang.Exception
ctx
- path
- ds
-
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |