yawda.utils.cayenne
Class JNDIDatasourceFactory

java.lang.Object
  extended byyawda.utils.cayenne.JNDIDatasourceFactory
All Implemented Interfaces:
org.objectstyle.cayenne.conf.DataSourceFactory

public final class JNDIDatasourceFactory
extends Object
implements org.objectstyle.cayenne.conf.DataSourceFactory

Author:
Quentin Anciaux

Field Summary
protected  org.objectstyle.cayenne.conf.Configuration parentConfig
           
 
Constructor Summary
JNDIDatasourceFactory()
           
 
Method Summary
 DataSource getDataSource(String location)
          Returns DataSource object corresponding to location.
 DataSource getDataSource(String location, org.apache.log4j.Level logLevel)
           
 void initializeWithParentConfiguration(org.objectstyle.cayenne.conf.Configuration conf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentConfig

protected org.objectstyle.cayenne.conf.Configuration parentConfig
Constructor Detail

JNDIDatasourceFactory

public JNDIDatasourceFactory()
                      throws Exception
Method Detail

getDataSource

public final DataSource getDataSource(String location)
                               throws Exception
Returns DataSource object corresponding to location. Location is expected to be a path mapped in JNDI InitialContext.

Specified by:
getDataSource in interface org.objectstyle.cayenne.conf.DataSourceFactory
Throws:
Exception

initializeWithParentConfiguration

public final void initializeWithParentConfiguration(org.objectstyle.cayenne.conf.Configuration conf)
Specified by:
initializeWithParentConfiguration in interface org.objectstyle.cayenne.conf.DataSourceFactory

getDataSource

public final DataSource getDataSource(String location,
                                      org.apache.log4j.Level logLevel)
                               throws Exception
Specified by:
getDataSource in interface org.objectstyle.cayenne.conf.DataSourceFactory
Throws:
Exception