Class DelegatingDataSourceFactory
java.lang.Object
org.apache.cayenne.configuration.runtime.DelegatingDataSourceFactory
- All Implemented Interfaces:
DataSourceFactory
A
DataSourceFactory that delegates DataSource creation to another factory,
which is determined dynamically per DataNodeDescriptor. The delegate class may be
explicitly defined in the DataNodeDescriptor. If not, and if the descriptor has
a configuration resource attached to it, XMLPoolingDataSourceFactory is used.
If the environment contains properties cayenne.jdbc.url.domain_name.node_name
(or cayenne.jdbc.url) and cayenne.jdbc.driver.domain_name.node_name
(or cayenne.jdbc.driver), any DataSourceFactory configured in the
DataNodeDescriptor is ignored, and the PropertyDataSourceFactory is used.
- Since:
- 3.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<DataSource,ScopeEventListener> protected AdhocObjectFactoryprotected RuntimeProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidattachToScope(DataSource dataSource) Ensure that DataSource implementations returned from this factory receiveBeforeScopeEndevents.getDataSource(DataNodeDescriptor nodeDescriptor) Returns DataSource object based on the configuration provided in the "nodeDescriptor".protected DataSourceFactorygetDataSourceFactory(DataNodeDescriptor nodeDescriptor) protected booleanshouldConfigureDataSourceFromProperties(DataNodeDescriptor nodeDescriptor) voidshutdown()
-
Field Details
-
objectFactory
-
properties
-
managedDataSources
-
-
Constructor Details
-
DelegatingDataSourceFactory
public DelegatingDataSourceFactory()
-
-
Method Details
-
getDataSource
Description copied from interface:DataSourceFactoryReturns DataSource object based on the configuration provided in the "nodeDescriptor".- Specified by:
getDataSourcein interfaceDataSourceFactory- Throws:
Exception
-
shutdown
-
attachToScope
Ensure that DataSource implementations returned from this factory receiveBeforeScopeEndevents. -
getDataSourceFactory
-
shouldConfigureDataSourceFromProperties
-