Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.configuration.server
Class PropertyDataSourceFactory

    java.lang.Object
      org.apache.cayenne.configuration.server.PropertyDataSourceFactory

All Implemented Interfaces:
  DataSourceFactory

    public class PropertyDataSourceFactory

extends java.lang.Object
implements DataSourceFactory

A DataSourceFactrory that creates a DataSource based on system properties. Properties can be set per domain/node name or globally, aplying to all nodes without explicit property set. The following properties are supported:

- cayenne.jdbc.driver[.domain_name.node_name]
- cayenne.jdbc.url[.domain_name.node_name]
- cayenne.adapter[.domain_name.node_name]
- cayenne.jdbc.username[.domain_name.node_name]
- cayenne.jdbc.password[.domain_name.node_name]
- cayenne.jdbc.min.connections[.domain_name.node_name]
- cayenne.jdbc.max.conections[.domain_name.node_name]

At least url and driver properties must be specified for this factory to return a valid DataSource.

Since:
  3.1

Field Summary
`protected JdbcEventLogger` | `jdbcEventLogger`
`protected RuntimeProperties` | `properties`

Constructor Summary
`PropertyDataSourceFactory()`

Method Summary
`javax.sql.DataSource` | `getDataSource(DataNodeDescriptor nodeDescriptor)` Returns DataSource object based on the configuration provided in the "nodeDescriptor".
`protected int` | `getIntProperty(java.lang.String propertyName, java.lang.String suffix, int defaultValue)`
`protected java.lang.String` | `getProperty(java.lang.String propertyName, java.lang.String suffix)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### properties

    protected RuntimeProperties properties

### jdbcEventLogger

    protected JdbcEventLogger jdbcEventLogger

Constructor Detail

### PropertyDataSourceFactory

    public PropertyDataSourceFactory()

Method Detail

### getDataSource

    public javax.sql.DataSource getDataSource(DataNodeDescriptor nodeDescriptor)
                                       throws java.lang.Exception

  Description copied from interface: `DataSourceFactory`
  Returns DataSource object based on the configuration provided in the "nodeDescriptor".

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

### getIntProperty

    protected int getIntProperty(java.lang.String propertyName,
                                 java.lang.String suffix,
                                 int defaultValue)

### getProperty

    protected java.lang.String getProperty(java.lang.String propertyName,
                                           java.lang.String suffix)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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