org.apache.cayenne.conf
Class JNDIDataSourceFactory

java.lang.Object
  extended by org.apache.cayenne.conf.JNDIDataSourceFactory
All Implemented Interfaces:
DataSourceFactory

public class JNDIDataSourceFactory
extends Object
implements DataSourceFactory

Looks up DataSource objects via JNDI.


Field Summary
protected  Configuration parentConfig
           
 
Constructor Summary
JNDIDataSourceFactory()
           
 
Method Summary
 DataSource getDataSource(String location)
          Attempts to load DataSource using JNDI.
 void initializeWithParentConfiguration(Configuration conf)
          Initializes factory with the parent configuration object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentConfig

protected Configuration parentConfig
Constructor Detail

JNDIDataSourceFactory

public JNDIDataSourceFactory()
Method Detail

initializeWithParentConfiguration

public void initializeWithParentConfiguration(Configuration conf)
Description copied from interface: DataSourceFactory
Initializes factory with the parent configuration object.

Specified by:
initializeWithParentConfiguration in interface DataSourceFactory

getDataSource

public DataSource getDataSource(String location)
                         throws Exception
Attempts to load DataSource using JNDI. In case of failure tries to get the DataSource with the same name from CayenneModeler preferences.

Specified by:
getDataSource in interface DataSourceFactory
Throws:
Exception


Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.