Rename default connection pool properties file to server.default.properties and client.default.properties. This change would allow developer to create fragment to contribute a customize server.properties or client.properties

This commit is contained in:
Heng Sin Low 2011-01-19 16:55:38 +08:00
parent 8675e83423
commit 0ed2e11bd0
6 changed files with 16 additions and 2 deletions

View File

@ -553,9 +553,16 @@ public class DB_Oracle implements AdempiereDatabase
if (m_ds != null) if (m_ds != null)
return m_ds; return m_ds;
//try fragment contributed properties then default properties
URL url = Ini.isClient() URL url = Ini.isClient()
? OracleBundleActivator.bundleContext.getBundle().getEntry("META-INF/pool/client.properties") ? OracleBundleActivator.bundleContext.getBundle().getEntry("META-INF/pool/client.properties")
: OracleBundleActivator.bundleContext.getBundle().getEntry("META-INF/pool/server.properties"); : OracleBundleActivator.bundleContext.getBundle().getEntry("META-INF/pool/server.properties");
if (url == null)
{
url = Ini.isClient()
? OracleBundleActivator.bundleContext.getBundle().getEntry("META-INF/pool/client.default.properties")
: OracleBundleActivator.bundleContext.getBundle().getEntry("META-INF/pool/server.default.properties");
}
Properties poolProperties = new Properties(); Properties poolProperties = new Properties();
try { try {
poolProperties.load(url.openStream()); poolProperties.load(url.openStream());

View File

@ -616,9 +616,16 @@ public class DB_PostgreSQL implements AdempiereDatabase
if (m_ds != null) if (m_ds != null)
return m_ds; return m_ds;
//try fragment contributed properties then default properties
URL url = Ini.isClient() URL url = Ini.isClient()
? PostgreSQLBundleActivator.bundleContext.getBundle().getEntry("META-INF/pool/client.properties") ? PostgreSQLBundleActivator.bundleContext.getBundle().getEntry("META-INF/pool/client.properties")
: PostgreSQLBundleActivator.bundleContext.getBundle().getEntry("META-INF/pool/server.properties"); : PostgreSQLBundleActivator.bundleContext.getBundle().getEntry("META-INF/pool/server.properties");
if (url == null)
{
url = Ini.isClient()
? PostgreSQLBundleActivator.bundleContext.getBundle().getEntry("META-INF/pool/client.default.properties")
: PostgreSQLBundleActivator.bundleContext.getBundle().getEntry("META-INF/pool/server.default.properties");
}
Properties poolProperties = new Properties(); Properties poolProperties = new Properties();
try { try {
poolProperties.load(url.openStream()); poolProperties.load(url.openStream());