| Method from org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl Detail: |
public ConnectionDecorator[] getConnectionDecoratorInstances() {
if (connectionDecoratorPlugins.get() == null) {
connectionDecoratorPlugins.instantiate
(ConnectionDecorator.class, this);
}
return (ConnectionDecorator[]) connectionDecoratorPlugins.get();
}
|
public String getConnectionDecorators() {
return connectionDecoratorPlugins.getString();
}
|
public Object getConnectionFactory() {
// override to configure data source
if (dataSource == null) {
DecoratingDataSource ds = createConnectionFactory();
dataSource = DataSourceFactory.installDBDictionary
(getDBDictionaryInstance(), ds, this, false);
}
return dataSource;
}
|
public Object getConnectionFactory2() {
// override to configure data source
if (dataSource2 == null) {
// superclass will lookup from JNDI.
DataSource ds = (DataSource) super.getConnectionFactory2();
if (ds == null) {
// the driver name is always required, so if not specified,
// then no connection factory 2
String driver = getConnection2DriverName();
if (!StringUtils.isEmpty(driver))
ds = DataSourceFactory.newDataSource(this, true);
}
if (ds != null) {
DecoratingDataSource dds =
setupConnectionFactory(ds, true); // before dict
dataSource2 = DataSourceFactory.installDBDictionary
(getDBDictionaryInstance(), dds, this, true);
}
}
return dataSource2;
}
|
public String getDBDictionary() {
return dbdictionaryPlugin.getString();
}
|
public DBDictionary getDBDictionaryInstance() {
// lock on connection factory name, since getting the connection
// factory and getting the dictionary have to use the same locks to
// prevent deadlock since they call each other
DBDictionary dbdictionary = (DBDictionary) dbdictionaryPlugin.get();
if (dbdictionary == null) {
String clsName = dbdictionaryPlugin.getClassName();
String props = dbdictionaryPlugin.getProperties();
if (!StringUtils.isEmpty(clsName)) {
dbdictionary = DBDictionaryFactory.newDBDictionary
(this, clsName, props);
} else {
// if the dictionary class isn't set, try to guess from
// connection URL and driver name
dbdictionary = DBDictionaryFactory.calculateDBDictionary
(this, getConnectionURL(), getConnectionDriverName(),
props);
// if the url and driver name aren't enough, connect to
// the DB and use the connection metadata
if (dbdictionary == null) {
Log log = getLog(LOG_JDBC);
if (log.isTraceEnabled()) {
Localizer loc = Localizer.forPackage
(JDBCConfigurationImpl.class);
log.trace(loc.get("connecting-for-dictionary"));
}
// use the base connection factory rather than the
// configured data source b/c the data source relies
// on passing the connection through the dictionary,
// resulting in infinite loops
DataSource ds = createConnectionFactory();
dbdictionary = DBDictionaryFactory.newDBDictionary
(this, getDataSource(null, ds), props);
}
}
dbdictionaryPlugin.set(dbdictionary, true);
}
return dbdictionary;
}
|
public DataSource getDataSource(StoreContext ctx) {
return getDataSource(ctx, (DataSource) getConnectionFactory());
}
|
public DataSource getDataSource2(StoreContext ctx) {
// if there is no connection factory 2, use the primary factory
DataSource ds = (DataSource) getConnectionFactory2();
if (ds == null)
return getDataSource(ctx);
// prefer the global connection 2 auth info if given
String user = getConnection2UserName();
String pass = getConnection2Password();
if (user == null && pass == null) {
// no global auth info; use the context if given, or the first
// context if not
if (ctx == null) {
user = firstUser;
pass = firstPass;
} else {
user = ctx.getConnectionUserName();
pass = ctx.getConnectionPassword();
}
}
return DataSourceFactory.defaultsDataSource(ds, user, pass);
}
|
public String getDriverDataSource() {
return driverDataSourcePlugin.getString();
}
|
public String getEagerFetchMode() {
return eagerFetchMode.getString();
}
|
public int getEagerFetchModeConstant() {
return eagerFetchMode.get();
}
|
public String getFetchDirection() {
return fetchDirection.getString();
}
|
public int getFetchDirectionConstant() {
return fetchDirection.get();
}
|
public JDBCListener[] getJDBCListenerInstances() {
if (jdbcListenerPlugins.get() == null)
jdbcListenerPlugins.instantiate(JDBCListener.class, this);
return (JDBCListener[]) jdbcListenerPlugins.get();
}
|
public String getJDBCListeners() {
return jdbcListenerPlugins.getString();
}
|
public String getLRSSize() {
return lrsSize.getString();
}
|
public int getLRSSizeConstant() {
return lrsSize.get();
}
|
public String getMappingDefaults() {
return mappingDefaultsPlugin.getString();
}
|
public MappingDefaults getMappingDefaultsInstance() {
if (mappingDefaultsPlugin.get() == null)
mappingDefaultsPlugin.instantiate(MappingDefaults.class, this);
return (MappingDefaults) mappingDefaultsPlugin.get();
}
|
public String getMappingFactory() {
return mappingFactoryPlugin.getString();
}
|
public MappingRepository getMappingRepositoryInstance() {
return (MappingRepository) getMetaDataRepositoryInstance();
}
|
public String getResultSetType() {
return resultSetType.getString();
}
|
public int getResultSetTypeConstant() {
return resultSetType.get();
}
|
public String getSQLFactory() {
return sqlFactoryPlugin.getString();
}
|
public SQLFactory getSQLFactoryInstance() {
if (sqlFactoryPlugin.get() == null)
sqlFactoryPlugin.instantiate(SQLFactory.class, this);
return (SQLFactory) sqlFactoryPlugin.get();
}
|
public String getSchema() {
return schema.getString();
}
|
public String getSchemaFactory() {
return schemaFactoryPlugin.getString();
}
|
public SchemaFactory getSchemaFactoryInstance() {
if (schemaFactoryPlugin.get() == null)
schemaFactoryPlugin.instantiate(SchemaFactory.class, this);
return (SchemaFactory) schemaFactoryPlugin.get();
}
|
public String getSchemas() {
return schemas.getString();
}
|
public String[] getSchemasList() {
return schemas.get();
}
|
public String getSubclassFetchMode() {
return subclassFetchMode.getString();
}
|
public int getSubclassFetchModeConstant() {
return subclassFetchMode.get();
}
|
public String getSynchronizeMappings() {
return synchronizeMappings.get();
}
|
public String getTransactionIsolation() {
return transactionIsolation.getString();
}
|
public int getTransactionIsolationConstant() {
return transactionIsolation.get();
}
|
public String getUpdateManager() {
return updateManagerPlugin.getString();
}
|
public UpdateManager getUpdateManagerInstance() {
if (updateManagerPlugin.get() == null)
updateManagerPlugin.instantiate(UpdateManager.class, this);
return (UpdateManager) updateManagerPlugin.get();
}
|
protected boolean isInvalidProperty(String propName) {
if (super.isInvalidProperty(propName))
return true;
// handle openjpa.jdbc.SomeMisspelledProperty, but not
// openjpa.someotherimplementation.SomeProperty
String[] prefixes = ProductDerivations.getConfigurationPrefixes();
for (int i = 0; i < prefixes.length; i++)
if (propName.toLowerCase().startsWith(prefixes[i] + ".jdbc"))
return true;
return false;
}
|
public BrokerImpl newBrokerInstance(String user,
String pass) {
BrokerImpl broker = super.newBrokerInstance(user, pass);
// record first non-null broker user and pass in case no global settings
if (broker != null && user != null && firstUser == null) {
firstUser = user;
firstPass = pass;
}
return broker;
}
|
public DriverDataSource newDriverDataSourceInstance() {
return (DriverDataSource) driverDataSourcePlugin.
instantiate(DriverDataSource.class, this);
}
|
public MappingRepository newMappingRepositoryInstance() {
return (MappingRepository) newMetaDataRepositoryInstance();
}
|
public MetaDataFactory newMetaDataFactoryInstance() {
return mappingFactoryPlugin.instantiateMetaDataFactory(this,
metaFactoryPlugin, getMapping());
}
|
protected void preClose() {
if (dataSource != null) {
getDBDictionaryInstance().closeDataSource(dataSource);
connectionFactory.set(null, true); // so super doesn't close it
}
if (dataSource2 != null) {
getDBDictionaryInstance().closeDataSource(dataSource);
connectionFactory2.set(null, true); // so super doesn't close it
}
super.preClose();
}
|
public void setConnectionDecorators(String connectionDecorators) {
connectionDecoratorPlugins.setString(connectionDecorators);
}
|
public void setConnectionDecorators(ConnectionDecorator[] decorators) {
connectionDecoratorPlugins.set(decorators);
}
|
public void setConnectionFactory(Object factory) {
// there's a lot of one-time initialization involved for
// connection factories, so ignore resets
if (factory == connectionFactory.get())
return;
// override to configure data source
if (factory != null) {
// need to ensure it is decorated before we set the dict
DecoratingDataSource ds =
setupConnectionFactory((DataSource) factory, false);
dataSource = DataSourceFactory.installDBDictionary
(getDBDictionaryInstance(), ds, this, false);
} else
connectionFactory.set(null);
}
|
public void setConnectionFactory2(Object factory) {
if (factory == connectionFactory2.get())
return;
// override to configure data source
if (factory != null) {
// need to ensure it is decorated before we set the dict
DecoratingDataSource ds = setupConnectionFactory((DataSource)
factory, true);
dataSource2 = DataSourceFactory.installDBDictionary
(getDBDictionaryInstance(), ds, this, true);
} else
connectionFactory2.set(null);
}
|
public void setDBDictionary(String dbdictionary) {
dbdictionaryPlugin.setString(dbdictionary);
}
|
public void setDBDictionary(DBDictionary dbdictionary) {
// we can't allow the dictionary to be set after the connection
// factory, due to initialization issues
if (connectionFactory.get() != null
|| connectionFactory2.get() != null)
throw new IllegalStateException();
dbdictionaryPlugin.set(dbdictionary);
}
|
public void setDriverDataSource(String driverDataSource) {
driverDataSourcePlugin.setString(driverDataSource);
}
|
public void setEagerFetchMode(String eagerFetchMode) {
this.eagerFetchMode.setString(eagerFetchMode);
}
|
public void setEagerFetchMode(int eagerFetchMode) {
this.eagerFetchMode.set(eagerFetchMode);
}
|
public void setFetchDirection(String fetchDirection) {
this.fetchDirection.setString(fetchDirection);
}
|
public void setFetchDirection(int fetchDirection) {
this.fetchDirection.set(fetchDirection);
}
|
public void setJDBCListeners(String jdbcListeners) {
jdbcListenerPlugins.setString(jdbcListeners);
}
|
public void setJDBCListeners(JDBCListener[] listeners) {
jdbcListenerPlugins.set(listeners);
}
|
public void setLRSSize(String lrsSize) {
this.lrsSize.setString(lrsSize);
}
|
public void setLRSSize(int lrsSize) {
this.lrsSize.set(lrsSize);
}
|
public void setMappingDefaults(String mapping) {
this.mappingDefaultsPlugin.setString(mapping);
}
|
public void setMappingDefaults(MappingDefaults mapping) {
mappingDefaultsPlugin.set(mapping);
}
|
public void setMappingFactory(String mapping) {
mappingFactoryPlugin.setString(mapping);
}
|
public void setResultSetType(String resultSetType) {
this.resultSetType.setString(resultSetType);
}
|
public void setResultSetType(int resultSetType) {
this.resultSetType.set(resultSetType);
}
|
public void setSQLFactory(String sqlFactory) {
sqlFactoryPlugin.setString(sqlFactory);
}
|
public void setSQLFactory(SQLFactory sqlFactory) {
sqlFactoryPlugin.set(sqlFactory);
}
|
public void setSchema(String schema) {
this.schema.setString(schema);
}
|
public void setSchemaFactory(String schemaFactory) {
schemaFactoryPlugin.setString(schemaFactory);
}
|
public void setSchemaFactory(SchemaFactory schemaFactory) {
schemaFactoryPlugin.set(schemaFactory);
}
|
public void setSchemas(String schemas) {
this.schemas.setString(schemas);
}
|
public void setSchemas(String[] schemas) {
this.schemas.set(schemas);
}
|
public void setSubclassFetchMode(String subclassFetchMode) {
this.subclassFetchMode.setString(subclassFetchMode);
}
|
public void setSubclassFetchMode(int subclassFetchMode) {
this.subclassFetchMode.set(subclassFetchMode);
}
|
public void setSynchronizeMappings(String synchronizeMappings) {
this.synchronizeMappings.set(synchronizeMappings);
}
|
public void setTransactionIsolation(String transactionIsolation) {
this.transactionIsolation.setString(transactionIsolation);
}
|
public void setTransactionIsolation(int transactionIsolation) {
this.transactionIsolation.set(transactionIsolation);
}
|
public void setUpdateManager(String updateManager) {
updateManagerPlugin.setString(updateManager);
}
|
public void setUpdateManager(UpdateManager updateManager) {
updateManagerPlugin.set(updateManager);
}
|