org.apache.cayenne.conf
Class DriverDataSourceFactory

java.lang.Object
  extended by org.apache.cayenne.conf.DriverDataSourceFactory
All Implemented Interfaces:
DataSourceFactory
Direct Known Subclasses:
ProjectDataSourceFactory

public class DriverDataSourceFactory
extends java.lang.Object
implements DataSourceFactory

Creates DataSource objects from XML configuration files that describe a JDBC driver. Wraps JDBC driver in a generic DataSource implementation.

Author:
Andrei Adamchik

Field Summary
protected  DataSourceInfo driverInfo
           
protected  Configuration parentConfiguration
           
protected  org.xml.sax.XMLReader parser
           
 
Constructor Summary
DriverDataSourceFactory()
          Creates new DriverDataSourceFactory.
 
Method Summary
 javax.sql.DataSource getDataSource(java.lang.String location)
          Returns DataSource object corresponding to location.
 javax.sql.DataSource getDataSource(java.lang.String location, org.apache.log4j.Level logLevel)
          Deprecated. since 1.2
protected  DataSourceInfo getDriverInfo()
          Returns DataSourceInfo property.
protected  java.io.InputStream getInputStream(java.lang.String location)
           
 void initializeWithParentConfiguration(Configuration parentConfiguration)
          Stores configuration object internally to use it later for resource loading.
protected  void load(java.lang.String location)
          Loads driver information from the file at location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

protected org.xml.sax.XMLReader parser

driverInfo

protected DataSourceInfo driverInfo

parentConfiguration

protected Configuration parentConfiguration
Constructor Detail

DriverDataSourceFactory

public DriverDataSourceFactory()
                        throws java.lang.Exception
Creates new DriverDataSourceFactory.

Throws:
java.lang.Exception
Method Detail

initializeWithParentConfiguration

public void initializeWithParentConfiguration(Configuration parentConfiguration)
Stores configuration object internally to use it later for resource loading.

Specified by:
initializeWithParentConfiguration in interface DataSourceFactory

getDataSource

public javax.sql.DataSource getDataSource(java.lang.String location,
                                          org.apache.log4j.Level logLevel)
                                   throws java.lang.Exception
Deprecated. since 1.2

Specified by:
getDataSource in interface DataSourceFactory
Throws:
java.lang.Exception

getDataSource

public javax.sql.DataSource getDataSource(java.lang.String location)
                                   throws java.lang.Exception
Description copied from interface: DataSourceFactory
Returns DataSource object corresponding to location. Concrete implementations may treat location differently - as a file path, JNDI location, etc.

Specified by:
getDataSource in interface DataSourceFactory
Throws:
java.lang.Exception

getDriverInfo

protected DataSourceInfo getDriverInfo()
Returns DataSourceInfo property.


getInputStream

protected java.io.InputStream getInputStream(java.lang.String location)

load

protected void load(java.lang.String location)
             throws java.lang.Exception
Loads driver information from the file at location. Called internally from "getDataSource"

Throws:
java.lang.Exception


Copyright © 2001-2006 Apache.org All Rights Reserved.