Author: jacopoc
Date: Sat Aug 23 07:03:04 2014 New Revision: 1619976 URL: http://svn.apache.org/r1619976 Log: EntityConfig now implements the singleton pattern; thread safety is implemented with a static initialization. Removed the EntityConfigUtil class whose main purpose was to guarantee that only one instance of EntityConfig would be initialized (no more required since now EntityConfig is a singleton); moved a couple of its static methods to the EntityConfig class. Removed: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/EntityConfigUtil.java Modified: ofbiz/branches/framework-api-cleanup/applications/product/src/org/ofbiz/product/product/ProductSearch.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/GenericDelegator.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ConnectionFactory.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/Datasource.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/DebugXaResources.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/DelegatorElement.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityConfig.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityDataReader.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityEcaReader.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityGroupReader.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityModelReader.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/FieldType.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/GroupMap.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/InlineJdbc.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/JndiJdbc.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ReadData.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/Resource.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ResourceLoader.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/SqlLoadPath.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TransactionFactory.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TransactionManagerJndi.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TyrexDataSource.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/UserTransactionJndi.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/GenericHelperFactory.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/MemoryHelper.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/ConnectionFactory.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/SQLProcessor.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelFieldTypeReader.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelReader.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/DumbFactory.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/JNDIFactory.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/TransactionFactoryLoader.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java ofbiz/branches/framework-api-cleanup/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java ofbiz/branches/framework-api-cleanup/framework/geronimo/src/org/ofbiz/geronimo/GeronimoTransactionFactory.java ofbiz/branches/framework-api-cleanup/framework/service/src/org/ofbiz/service/DispatchContext.java ofbiz/branches/framework-api-cleanup/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java ofbiz/branches/framework-api-cleanup/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelReferences.java ofbiz/branches/framework-api-cleanup/framework/webtools/webapp/webtools/entity/ModelWriter.jsp Modified: ofbiz/branches/framework-api-cleanup/applications/product/src/org/ofbiz/product/product/ProductSearch.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/applications/product/src/org/ofbiz/product/product/ProductSearch.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/applications/product/src/org/ofbiz/product/product/ProductSearch.java (original) +++ ofbiz/branches/framework-api-cleanup/applications/product/src/org/ofbiz/product/product/ProductSearch.java Sat Aug 23 07:03:04 2014 @@ -47,7 +47,7 @@ import org.ofbiz.entity.condition.Entity import org.ofbiz.entity.condition.EntityConditionSubSelect; import org.ofbiz.entity.condition.EntityConditionValue; import org.ofbiz.entity.condition.EntityOperator; -import org.ofbiz.entity.config.EntityConfigUtil; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.model.DynamicViewEntity; import org.ofbiz.entity.model.ModelKeyMap; import org.ofbiz.entity.model.ModelViewEntity.ComplexAlias; @@ -647,7 +647,7 @@ public class ProductSearch { this.entityConditionList.add(topCond); - Debug.logInfo("topCond=" + topCond.makeWhereString(null, FastList.<EntityConditionParam>newInstance(), EntityConfigUtil.getDatasource(delegator.getEntityHelperName("Product"))), module); + Debug.logInfo("topCond=" + topCond.makeWhereString(null, FastList.<EntityConditionParam>newInstance(), EntityConfig.getDatasource(delegator.getEntityHelperName("Product"))), module); } public EntityListIterator doQuery(Delegator delegator) { Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/GenericDelegator.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Sat Aug 23 07:03:04 2014 @@ -52,9 +52,9 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.entity.cache.Cache; import org.ofbiz.entity.condition.EntityCondition; -import org.ofbiz.entity.config.EntityConfigUtil; import org.ofbiz.entity.config.model.Datasource; import org.ofbiz.entity.config.model.DelegatorElement; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.datasource.GenericHelper; import org.ofbiz.entity.datasource.GenericHelperFactory; import org.ofbiz.entity.datasource.GenericHelperInfo; @@ -210,7 +210,7 @@ public class GenericDelegator implements protected GenericDelegator(String delegatorFullName) throws GenericEntityException { //if (Debug.infoOn()) Debug.logInfo("Creating new Delegator with name \"" + delegatorFullName + "\".", module); this.setDelegatorNames(delegatorFullName); - this.delegatorInfo = EntityConfigUtil.getDelegator(delegatorBaseName); + this.delegatorInfo = EntityConfig.getInstance().getDelegator(delegatorBaseName); String kekText; // before continuing, if there is a tenantId use the base delegator to see if it is valid @@ -282,7 +282,7 @@ public class GenericDelegator implements GenericHelper helper = GenericHelperFactory.getHelper(helperInfo); try { - Datasource datasource = EntityConfigUtil.getDatasource(helperBaseName); + Datasource datasource = EntityConfig.getDatasource(helperBaseName); if (datasource.getCheckOnStart()) { if (Debug.infoOn()) { Debug.logInfo("Doing database check as requested in entityengine.xml with addMissing=" + datasource.getAddMissingOnStart(), module); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ConnectionFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ConnectionFactory.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ConnectionFactory.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ConnectionFactory.java Sat Aug 23 07:03:04 2014 @@ -20,7 +20,6 @@ package org.ofbiz.entity.config.model; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -34,7 +33,7 @@ public final class ConnectionFactory { private final String className; // type = xs:string ConnectionFactory(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String className = element.getAttribute("class").intern(); if (className.isEmpty()) { throw new GenericEntityConfException("<connection-factory> element class attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/Datasource.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/Datasource.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/Datasource.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/Datasource.java Sat Aug 23 07:03:04 2014 @@ -25,7 +25,6 @@ import java.util.List; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.base.util.UtilXml; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -83,7 +82,7 @@ public final class Datasource { private final TyrexDataSource tyrexDataSource; // <tyrex-dataSource> Datasource(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String name = element.getAttribute("name").intern(); if (name.isEmpty()) { throw new GenericEntityConfException("<datasource> element name attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/DebugXaResources.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/DebugXaResources.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/DebugXaResources.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/DebugXaResources.java Sat Aug 23 07:03:04 2014 @@ -20,7 +20,6 @@ package org.ofbiz.entity.config.model; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -34,7 +33,7 @@ public final class DebugXaResources { private final boolean value; // type = xs:string DebugXaResources(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String value = element.getAttribute("value").intern(); if (value.isEmpty()) { throw new GenericEntityConfException("<debug-xa-resources> element value attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/DelegatorElement.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/DelegatorElement.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/DelegatorElement.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/DelegatorElement.java Sat Aug 23 07:03:04 2014 @@ -27,7 +27,6 @@ import java.util.HashMap; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.base.util.UtilXml; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -54,7 +53,7 @@ public final class DelegatorElement { private final Map<String, String> groupMapMap; // <group-map> DelegatorElement(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String name = element.getAttribute("name").intern(); if (name.isEmpty()) { throw new GenericEntityConfException("<delegator> element name attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityConfig.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityConfig.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityConfig.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityConfig.java Sat Aug 23 07:03:04 2014 @@ -18,6 +18,7 @@ *******************************************************************************/ package org.ofbiz.entity.config.model; +import java.net.URL; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -25,18 +26,25 @@ import java.util.Map; import java.util.HashMap; import org.ofbiz.base.lang.ThreadSafe; +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilProperties; +import org.ofbiz.base.util.UtilURL; import org.ofbiz.base.util.UtilXml; import org.ofbiz.entity.GenericEntityConfException; import org.w3c.dom.Element; /** - * An object that models the <code><entity-config></code> element. + * A singleton class that models the <code><entity-config></code> element. * * @see <code>entity-config.xsd</code> */ @ThreadSafe public final class EntityConfig { + public static final String ENTITY_ENGINE_XML_FILENAME = "entityengine.xml"; + private static final String module = EntityConfig.class.getName(); + + private static final EntityConfig instance = createNewInstance(); private final List<ResourceLoader> resourceLoaderList; // <resource-loader> private final Map<String, ResourceLoader> resourceLoaderMap; // <resource-loader> private final TransactionFactory transactionFactory; // <transaction-factory> @@ -57,7 +65,18 @@ public final class EntityConfig { private final List<Datasource> datasourceList; // <datasource> private final Map<String, Datasource> datasourceMap; - public EntityConfig(Element element) throws GenericEntityConfException { + private EntityConfig() throws GenericEntityConfException { + Element element; + URL confUrl = UtilURL.fromResource(ENTITY_ENGINE_XML_FILENAME); + if (confUrl == null) { + throw new GenericEntityConfException("Could not find the " + ENTITY_ENGINE_XML_FILENAME + " file"); + } + try { + element = UtilXml.readXmlDocument(confUrl, true, true).getDocumentElement(); + } catch (Exception e) { + throw new GenericEntityConfException("Exception thrown while reading " + ENTITY_ENGINE_XML_FILENAME + ": ", e); + } + List<? extends Element> resourceLoaderElementList = UtilXml.childElementList(element, "resource-loader"); if (resourceLoaderElementList.isEmpty()) { throw new GenericEntityConfException("<entity-config> element child elements <resource-loader> are missing"); @@ -192,6 +211,30 @@ public final class EntityConfig { } } + private static EntityConfig createNewInstance() { + EntityConfig entityConfig = null; + try { + entityConfig = new EntityConfig(); + } catch (GenericEntityConfException gece) { + Debug.logError(gece, module); + } + return entityConfig; + } + + public static EntityConfig getInstance() throws GenericEntityConfException { + if (instance == null) { + throw new GenericEntityConfException("EntityConfig is not initialized."); + } + return instance; + } + + public static String createConfigFileLineNumberText(Element element) { + if (element.getUserData("startLine") != null) { + return " [" + ENTITY_ENGINE_XML_FILENAME + " line " + element.getUserData("startLine") + "]"; + } + return ""; + } + /** Returns the specified <code><resource-loader></code> child element, or <code>null</code> if no child element was found. */ public ResourceLoader getResourceLoader(String name) { return this.resourceLoaderMap.get(name); @@ -283,9 +326,45 @@ public final class EntityConfig { } /** Returns the specified <code><datasource></code> child element or <code>null</code> if it does not exist. */ + /* public Datasource getDatasource(String name) { return this.datasourceMap.get(name); } + */ + public static Datasource getDatasource(String name) { + try { + return getInstance().datasourceMap.get(name); + } catch (GenericEntityConfException e) { + // FIXME: Doing this so we don't have to rewrite the entire API. + throw new RuntimeException(e); + } + } + + /** + * Returns the configured JDBC password. + * + * @param inlineJdbcElement + * @return The configured JDBC password. + * @throws GenericEntityConfException If the password was not found. + * + * @see <code>entity-config.xsd</code> + */ + public static String getJdbcPassword(InlineJdbc inlineJdbcElement) throws GenericEntityConfException { + String jdbcPassword = inlineJdbcElement.getJdbcPassword(); + if (!jdbcPassword.isEmpty()) { + return jdbcPassword; + } + String jdbcPasswordLookup = inlineJdbcElement.getJdbcPasswordLookup(); + if (jdbcPasswordLookup.isEmpty()) { + throw new GenericEntityConfException("No jdbc-password or jdbc-password-lookup specified for inline-jdbc element, line: " + inlineJdbcElement.getLineNumber()); + } + String key = "jdbc-password.".concat(jdbcPasswordLookup); + jdbcPassword = UtilProperties.getPropertyValue("passwords.properties", key); + if (jdbcPassword.isEmpty()) { + throw new GenericEntityConfException("'" + key + "' property not found in passwords.properties file for inline-jdbc element, line: " + inlineJdbcElement.getLineNumber()); + } + return jdbcPassword; + } /** Returns the <code><datasource></code> child elements as a <code>Map</code>. */ public Map<String, Datasource> getDatasourceMap() { Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityDataReader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityDataReader.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityDataReader.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityDataReader.java Sat Aug 23 07:03:04 2014 @@ -25,7 +25,6 @@ import java.util.List; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.base.util.UtilXml; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -48,7 +47,7 @@ public final class EntityDataReader { } EntityDataReader(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String name = element.getAttribute("name").intern(); if (name.isEmpty()) { throw new GenericEntityConfException("<entity-data-reader> element name attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityEcaReader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityEcaReader.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityEcaReader.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityEcaReader.java Sat Aug 23 07:03:04 2014 @@ -25,7 +25,6 @@ import java.util.List; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.base.util.UtilXml; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -40,7 +39,7 @@ public final class EntityEcaReader { private final List<Resource> resourceList; // <resource> EntityEcaReader(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String name = element.getAttribute("name").intern(); if (name.isEmpty()) { throw new GenericEntityConfException("<entity-eca-reader> element name attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityGroupReader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityGroupReader.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityGroupReader.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityGroupReader.java Sat Aug 23 07:03:04 2014 @@ -25,7 +25,6 @@ import java.util.List; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.base.util.UtilXml; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -42,7 +41,7 @@ public final class EntityGroupReader { private final List<Resource> resourceList; // <resource> EntityGroupReader(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String name = element.getAttribute("name").intern(); if (name.isEmpty()) { throw new GenericEntityConfException("<entity-group-reader> element name attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityModelReader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityModelReader.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityModelReader.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/EntityModelReader.java Sat Aug 23 07:03:04 2014 @@ -25,7 +25,6 @@ import java.util.List; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.base.util.UtilXml; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -40,7 +39,7 @@ public final class EntityModelReader { private final List<Resource> resourceList; // <resource> EntityModelReader(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String name = element.getAttribute("name").intern(); if (name.isEmpty()) { throw new GenericEntityConfException("<entity-model-reader> element name attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/FieldType.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/FieldType.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/FieldType.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/FieldType.java Sat Aug 23 07:03:04 2014 @@ -20,7 +20,6 @@ package org.ofbiz.entity.config.model; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -36,7 +35,7 @@ public final class FieldType { private final String location; // type = xs:string FieldType(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String name = element.getAttribute("name").intern(); if (name.isEmpty()) { throw new GenericEntityConfException("<field-type> element name attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/GroupMap.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/GroupMap.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/GroupMap.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/GroupMap.java Sat Aug 23 07:03:04 2014 @@ -20,7 +20,6 @@ package org.ofbiz.entity.config.model; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -35,7 +34,7 @@ public final class GroupMap { private final String datasourceName; // type = xs:string GroupMap(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String groupName = element.getAttribute("group-name").intern(); if (groupName.isEmpty()) { throw new GenericEntityConfException("<group-map> element group-name attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/InlineJdbc.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/InlineJdbc.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/InlineJdbc.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/InlineJdbc.java Sat Aug 23 07:03:04 2014 @@ -20,7 +20,6 @@ package org.ofbiz.entity.config.model; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -54,7 +53,7 @@ public final class InlineJdbc extends Jd InlineJdbc(Element element) throws GenericEntityConfException { super(element); - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String jdbcDriver = element.getAttribute("jdbc-driver").intern(); if (jdbcDriver.isEmpty()) { throw new GenericEntityConfException("<inline-jdbc> element jdbc-driver attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/JndiJdbc.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/JndiJdbc.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/JndiJdbc.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/JndiJdbc.java Sat Aug 23 07:03:04 2014 @@ -20,7 +20,6 @@ package org.ofbiz.entity.config.model; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -36,7 +35,7 @@ public final class JndiJdbc extends Jdbc JndiJdbc(Element element) throws GenericEntityConfException { super(element); - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String jndiServerName = element.getAttribute("jndi-server-name").intern(); if (jndiServerName.isEmpty()) { throw new GenericEntityConfException("<jndi-jdbc> element jndi-server-name attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ReadData.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ReadData.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ReadData.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ReadData.java Sat Aug 23 07:03:04 2014 @@ -20,7 +20,6 @@ package org.ofbiz.entity.config.model; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -34,7 +33,7 @@ public final class ReadData { private final String readerName; // type = xs:string ReadData(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String readerName = element.getAttribute("reader-name").intern(); if (readerName.isEmpty()) { throw new GenericEntityConfException("<read-data> element reader-name attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/Resource.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/Resource.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/Resource.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/Resource.java Sat Aug 23 07:03:04 2014 @@ -20,7 +20,6 @@ package org.ofbiz.entity.config.model; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -35,7 +34,7 @@ public final class Resource { private final String location; // type = xs:string Resource(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String loader = element.getAttribute("loader").intern(); if (loader.isEmpty()) { throw new GenericEntityConfException("<resource> element loader attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ResourceLoader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ResourceLoader.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ResourceLoader.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/ResourceLoader.java Sat Aug 23 07:03:04 2014 @@ -20,7 +20,6 @@ package org.ofbiz.entity.config.model; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -37,7 +36,7 @@ public final class ResourceLoader { private final String prefix; // type = xs:string ResourceLoader(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String name = element.getAttribute("name").intern(); if (name.isEmpty()) { throw new GenericEntityConfException("<resource-loader> element name attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/SqlLoadPath.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/SqlLoadPath.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/SqlLoadPath.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/SqlLoadPath.java Sat Aug 23 07:03:04 2014 @@ -20,7 +20,6 @@ package org.ofbiz.entity.config.model; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -35,7 +34,7 @@ public final class SqlLoadPath { private final String prependEnv; // type = xs:string SqlLoadPath(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String path = element.getAttribute("path").intern(); if (path.isEmpty()) { throw new GenericEntityConfException("<sql-load-path> element path attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TransactionFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TransactionFactory.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TransactionFactory.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TransactionFactory.java Sat Aug 23 07:03:04 2014 @@ -21,7 +21,6 @@ package org.ofbiz.entity.config.model; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.base.util.UtilXml; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -37,7 +36,7 @@ public final class TransactionFactory { private final TransactionManagerJndi transactionManagerJndi; // <transaction-manager-jndi> TransactionFactory(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String className = element.getAttribute("class").intern(); if (className.isEmpty()) { throw new GenericEntityConfException("<transaction-factory> element class attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TransactionManagerJndi.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TransactionManagerJndi.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TransactionManagerJndi.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TransactionManagerJndi.java Sat Aug 23 07:03:04 2014 @@ -20,7 +20,6 @@ package org.ofbiz.entity.config.model; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -35,7 +34,7 @@ public final class TransactionManagerJnd private final String jndiName; // type = xs:string TransactionManagerJndi(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String jndiServerName = element.getAttribute("jndi-server-name").intern(); if (jndiServerName.isEmpty()) { throw new GenericEntityConfException("<transaction-manager-jndi> element jndi-server-name attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TyrexDataSource.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TyrexDataSource.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TyrexDataSource.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/TyrexDataSource.java Sat Aug 23 07:03:04 2014 @@ -20,7 +20,6 @@ package org.ofbiz.entity.config.model; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -35,7 +34,7 @@ public final class TyrexDataSource exten TyrexDataSource(Element element) throws GenericEntityConfException { super(element); - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String dataSourceName = element.getAttribute("dataSource-name").intern(); if (dataSourceName.isEmpty()) { throw new GenericEntityConfException("<tyrex-dataSource> element dataSource-name attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/UserTransactionJndi.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/UserTransactionJndi.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/UserTransactionJndi.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/config/model/UserTransactionJndi.java Sat Aug 23 07:03:04 2014 @@ -20,7 +20,6 @@ package org.ofbiz.entity.config.model; import org.ofbiz.base.lang.ThreadSafe; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.w3c.dom.Element; /** @@ -35,7 +34,7 @@ public final class UserTransactionJndi { private final String jndiName; // type = xs:string UserTransactionJndi(Element element) throws GenericEntityConfException { - String lineNumberText = EntityConfigUtil.createConfigFileLineNumberText(element); + String lineNumberText = EntityConfig.createConfigFileLineNumberText(element); String jndiServerName = element.getAttribute("jndi-server-name").intern(); if (jndiServerName.isEmpty()) { throw new GenericEntityConfException("<user-transaction-jndi> element jndi-server-name attribute is empty" + lineNumberText); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/connection/DBCPConnectionFactory.java Sat Aug 23 07:03:04 2014 @@ -40,7 +40,7 @@ import org.apache.commons.pool2.impl.Gen import org.ofbiz.base.util.Debug; import org.ofbiz.entity.GenericEntityConfException; import org.ofbiz.entity.GenericEntityException; -import org.ofbiz.entity.config.EntityConfigUtil; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.config.model.InlineJdbc; import org.ofbiz.entity.config.model.JdbcElement; import org.ofbiz.entity.datasource.GenericHelperInfo; @@ -73,7 +73,7 @@ public class DBCPConnectionFactory imple String jdbcUri = helperInfo.getOverrideJdbcUri(jdbcElement.getJdbcUri()); String jdbcUsername = helperInfo.getOverrideUsername(jdbcElement.getJdbcUsername()); - String jdbcPassword = helperInfo.getOverridePassword(EntityConfigUtil.getJdbcPassword(jdbcElement)); + String jdbcPassword = helperInfo.getOverridePassword(EntityConfig.getJdbcPassword(jdbcElement)); // pool settings int maxSize = jdbcElement.getPoolMaxsize(); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java Sat Aug 23 07:03:04 2014 @@ -43,7 +43,6 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.EntityLockedException; import org.ofbiz.entity.GenericDataSourceException; import org.ofbiz.entity.GenericEntity; -import org.ofbiz.entity.GenericEntityConfException; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericEntityNotFoundException; import org.ofbiz.entity.GenericModelException; @@ -53,7 +52,6 @@ import org.ofbiz.entity.condition.Entity import org.ofbiz.entity.condition.EntityConditionParam; import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.entity.config.model.*; -import org.ofbiz.entity.config.EntityConfigUtil; import org.ofbiz.entity.jdbc.DatabaseUtil; import org.ofbiz.entity.jdbc.SQLProcessor; import org.ofbiz.entity.jdbc.SqlJdbcUtil; @@ -95,7 +93,7 @@ public class GenericDAO { public GenericDAO(GenericHelperInfo helperInfo) { this.helperInfo = helperInfo; this.modelFieldTypeReader = ModelFieldTypeReader.getModelFieldTypeReader(helperInfo.getHelperBaseName()); - this.datasource = EntityConfigUtil.getDatasource(helperInfo.getHelperBaseName()); + this.datasource = EntityConfig.getDatasource(helperInfo.getHelperBaseName()); this.executor = ExecutionPool.getScheduledExecutor(GENERIC_DAO_THREAD_GROUP, "OFBiz-entity-datasource(" + helperInfo.getHelperFullName() + ")", datasource.getMaxWorkerPoolSize(), false); } Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/GenericHelperFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/GenericHelperFactory.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/GenericHelperFactory.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/GenericHelperFactory.java Sat Aug 23 07:03:04 2014 @@ -24,7 +24,7 @@ import java.util.Map; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.config.model.Datasource; -import org.ofbiz.entity.config.EntityConfigUtil; +import org.ofbiz.entity.config.model.EntityConfig; /** * Generic Entity Helper Factory Class @@ -46,7 +46,7 @@ public class GenericHelperFactory { helper = helperCache.get(helperInfo.getHelperFullName()); if (helper == null) { try { - Datasource datasourceInfo = EntityConfigUtil.getDatasource(helperInfo.getHelperBaseName()); + Datasource datasourceInfo = EntityConfig.getDatasource(helperInfo.getHelperBaseName()); if (datasourceInfo == null) { throw new IllegalStateException("Could not find datasource definition with name " + helperInfo.getHelperBaseName()); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/MemoryHelper.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/MemoryHelper.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/MemoryHelper.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/datasource/MemoryHelper.java Sat Aug 23 07:03:04 2014 @@ -39,8 +39,8 @@ import org.ofbiz.entity.GenericNotImplem import org.ofbiz.entity.GenericPK; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.config.model.Datasource; -import org.ofbiz.entity.config.EntityConfigUtil; import org.ofbiz.entity.condition.EntityCondition; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.jdbc.SqlJdbcUtil; import org.ofbiz.entity.model.ModelEntity; import org.ofbiz.entity.model.ModelField; @@ -281,7 +281,7 @@ public class MemoryHelper implements Gen public MemoryHelper(String helperName) { this.helperName = helperName; modelFieldTypeReader = ModelFieldTypeReader.getModelFieldTypeReader(helperName); - Datasource datasourceInfo = EntityConfigUtil.getDatasource(helperName); + Datasource datasourceInfo = EntityConfig.getDatasource(helperName); this.executor = ExecutionPool.getScheduledExecutor(MEMORY_HELPER_THREAD_GROUP, "OFBiz-entity-datasource(" + helperName + ")", datasourceInfo.getMaxWorkerPoolSize(), false); } Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/ConnectionFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/ConnectionFactory.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/ConnectionFactory.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/ConnectionFactory.java Sat Aug 23 07:03:04 2014 @@ -28,7 +28,7 @@ import java.util.concurrent.atomic.Atomi import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericEntityException; -import org.ofbiz.entity.config.EntityConfigUtil; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.config.model.JdbcElement; import org.ofbiz.entity.connection.ConnectionFactoryInterface; import org.ofbiz.entity.datasource.GenericHelperInfo; @@ -44,7 +44,7 @@ public class ConnectionFactory { private static final AtomicReference<ConnectionFactoryInterface> connFactoryRef = new AtomicReference<ConnectionFactoryInterface>(null); private static ConnectionFactoryInterface createConnectionFactoryInterface() throws Exception { - String className = EntityConfigUtil.getConnectionFactoryClass(); + String className = EntityConfig.getInstance().getConnectionFactory().getClassName(); if (className == null) { throw new IllegalStateException("Could not find connection factory class name definition"); } Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java Sat Aug 23 07:03:04 2014 @@ -47,7 +47,7 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.config.model.Datasource; -import org.ofbiz.entity.config.EntityConfigUtil; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.datasource.GenericHelperInfo; import org.ofbiz.entity.model.ModelEntity; import org.ofbiz.entity.model.ModelField; @@ -91,7 +91,7 @@ public class DatabaseUtil { public DatabaseUtil(GenericHelperInfo helperInfo, ExecutorService executor) { this.helperInfo = helperInfo; this.modelFieldTypeReader = ModelFieldTypeReader.getModelFieldTypeReader(helperInfo.getHelperBaseName()); - this.datasourceInfo = EntityConfigUtil.getDatasource(helperInfo.getHelperBaseName()); + this.datasourceInfo = EntityConfig.getDatasource(helperInfo.getHelperBaseName()); this.executor = executor; } Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/SQLProcessor.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/SQLProcessor.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/SQLProcessor.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/jdbc/SQLProcessor.java Sat Aug 23 07:03:04 2014 @@ -40,7 +40,7 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericDataSourceException; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.config.model.Datasource; -import org.ofbiz.entity.config.EntityConfigUtil; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.datasource.GenericHelperInfo; import org.ofbiz.entity.transaction.GenericTransactionException; import org.ofbiz.entity.transaction.TransactionUtil; @@ -753,7 +753,7 @@ public class SQLProcessor { if (field != null) { _ps.setBlob(_ind, field); } else { - Datasource datasourceInfo = EntityConfigUtil.getDatasource(this.helperInfo.getHelperBaseName()); + Datasource datasourceInfo = EntityConfig.getDatasource(this.helperInfo.getHelperBaseName()); if (datasourceInfo.getUseBinaryTypeForBlob()) { _ps.setNull(_ind, Types.BINARY); } else { @@ -804,7 +804,7 @@ public class SQLProcessor { throw new SQLException(ex.getMessage()); } } else { - Datasource datasourceInfo = EntityConfigUtil.getDatasource(this.helperInfo.getHelperBaseName()); + Datasource datasourceInfo = EntityConfig.getDatasource(this.helperInfo.getHelperBaseName()); if (datasourceInfo.getUseBinaryTypeForBlob()) { _ps.setNull(_ind, Types.BINARY); } else { @@ -827,7 +827,7 @@ public class SQLProcessor { if (bytes != null) { _ps.setBytes(_ind, bytes); } else { - Datasource datasourceInfo = EntityConfigUtil.getDatasource(this.helperInfo.getHelperBaseName()); + Datasource datasourceInfo = EntityConfig.getDatasource(this.helperInfo.getHelperBaseName()); if (datasourceInfo.getUseBinaryTypeForBlob()) { _ps.setNull(_ind, Types.BINARY); } else { @@ -865,7 +865,7 @@ public class SQLProcessor { // check if the statement was called with a specific fetch size, if not grab the default from the datasource if (fetchSize < 0) { - Datasource ds = EntityConfigUtil.getDatasource(this.helperInfo.getHelperBaseName()); + Datasource ds = EntityConfig.getDatasource(this.helperInfo.getHelperBaseName()); if (ds != null) { fetchSize = ds.getResultFetchSize(); } else { Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java Sat Aug 23 07:03:04 2014 @@ -47,8 +47,8 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntity; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; -import org.ofbiz.entity.config.EntityConfigUtil; import org.ofbiz.entity.config.model.Datasource; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.jdbc.DatabaseUtil; import org.ofbiz.entity.model.ModelIndex.Field; import org.w3c.dom.Document; @@ -407,7 +407,7 @@ public class ModelEntity implements Comp /** The table-name of the Entity including a Schema name if specified in the datasource config */ public String getTableName(String helperName) { - return getTableName(EntityConfigUtil.getDatasource(helperName)); + return getTableName(EntityConfig.getDatasource(helperName)); } /** The table-name of the Entity including a Schema name if specified in the datasource config */ Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelFieldTypeReader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelFieldTypeReader.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelFieldTypeReader.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelFieldTypeReader.java Sat Aug 23 07:03:04 2014 @@ -33,8 +33,8 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.ofbiz.entity.config.model.Datasource; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.config.model.FieldType; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -66,7 +66,7 @@ public class ModelFieldTypeReader implem } public static ModelFieldTypeReader getModelFieldTypeReader(String helperName) { - Datasource datasourceInfo = EntityConfigUtil.getDatasource(helperName); + Datasource datasourceInfo = EntityConfig.getDatasource(helperName); if (datasourceInfo == null) { throw new IllegalArgumentException("Could not find a datasource/helper with the name " + helperName); } @@ -75,14 +75,14 @@ public class ModelFieldTypeReader implem while (reader == null) { FieldType fieldTypeInfo = null; try { - fieldTypeInfo = EntityConfigUtil.getFieldType(tempModelName); + fieldTypeInfo = EntityConfig.getInstance().getFieldType(tempModelName); } catch (GenericEntityConfException e) { Debug.logWarning(e, "Exception thrown while getting field type config: ", module); } if (fieldTypeInfo == null) { throw new IllegalArgumentException("Could not find a field-type definition with name \"" + tempModelName + "\""); } - ResourceHandler fieldTypeResourceHandler = new MainResourceHandler(EntityConfigUtil.ENTITY_ENGINE_XML_FILENAME, fieldTypeInfo.getLoader(), fieldTypeInfo.getLocation()); + ResourceHandler fieldTypeResourceHandler = new MainResourceHandler(EntityConfig.ENTITY_ENGINE_XML_FILENAME, fieldTypeInfo.getLoader(), fieldTypeInfo.getLocation()); UtilTimer utilTimer = new UtilTimer(); utilTimer.timerString("[ModelFieldTypeReader.getModelFieldTypeReader] Reading field types from " + fieldTypeResourceHandler.getLocation()); Document document = null; Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java Sat Aug 23 07:03:04 2014 @@ -37,8 +37,8 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.ofbiz.entity.config.model.DelegatorElement; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.config.model.EntityGroupReader; import org.ofbiz.entity.config.model.Resource; import org.w3c.dom.Document; @@ -62,7 +62,7 @@ public class ModelGroupReader implements public List<ResourceHandler> entityGroupResourceHandlers = new LinkedList<ResourceHandler>(); public static ModelGroupReader getModelGroupReader(String delegatorName) throws GenericEntityConfException { - DelegatorElement delegatorInfo = EntityConfigUtil.getDelegator(delegatorName); + DelegatorElement delegatorInfo = EntityConfig.getInstance().getDelegator(delegatorName); if (delegatorInfo == null) { throw new GenericEntityConfException("Could not find a delegator with the name " + delegatorName); @@ -79,13 +79,13 @@ public class ModelGroupReader implements public ModelGroupReader(String modelName) throws GenericEntityConfException { this.modelName = modelName; - EntityGroupReader entityGroupReaderInfo = EntityConfigUtil.getEntityGroupReader(modelName); + EntityGroupReader entityGroupReaderInfo = EntityConfig.getInstance().getEntityGroupReader(modelName); if (entityGroupReaderInfo == null) { throw new GenericEntityConfException("Cound not find an entity-group-reader with the name " + modelName); } for (Resource resourceElement: entityGroupReaderInfo.getResourceList()) { - this.entityGroupResourceHandlers.add(new MainResourceHandler(EntityConfigUtil.ENTITY_ENGINE_XML_FILENAME, resourceElement.getLoader(), resourceElement.getLocation())); + this.entityGroupResourceHandlers.add(new MainResourceHandler(EntityConfig.ENTITY_ENGINE_XML_FILENAME, resourceElement.getLoader(), resourceElement.getLocation())); } // get all of the component resource group stuff, ie specified in each ofbiz-component.xml file @@ -171,7 +171,7 @@ public class ModelGroupReader implements if (groupName == null) { DelegatorElement delegatorInfo = null; try { - delegatorInfo = EntityConfigUtil.getDelegator(delegatorBaseName); + delegatorInfo = EntityConfig.getInstance().getDelegator(delegatorBaseName); } catch (GenericEntityConfException e) { Debug.logWarning(e, "Exception thrown while getting delegator config: ", module); } @@ -197,7 +197,7 @@ public class ModelGroupReader implements if (this.groupNames == null) return null; Set<String> newSet = new HashSet<String>(); try { - newSet.add(EntityConfigUtil.getDelegator(delegatorBaseName).getDefaultGroupName()); + newSet.add(EntityConfig.getInstance().getDelegator(delegatorBaseName).getDefaultGroupName()); } catch (GenericEntityConfException e) { Debug.logWarning(e, "Exception thrown while getting delegator config: ", module); } Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelReader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelReader.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelReader.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/model/ModelReader.java Sat Aug 23 07:03:04 2014 @@ -42,8 +42,8 @@ import org.ofbiz.base.util.cache.UtilCac import org.ofbiz.entity.GenericEntityConfException; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericModelException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.ofbiz.entity.config.model.DelegatorElement; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.config.model.EntityModelReader; import org.ofbiz.entity.config.model.Resource; import org.w3c.dom.Document; @@ -80,7 +80,7 @@ public class ModelReader implements Seri protected Map<String, ResourceHandler> entityResourceHandlerMap; public static ModelReader getModelReader(String delegatorName) throws GenericEntityException { - DelegatorElement delegatorInfo = EntityConfigUtil.getDelegator(delegatorName); + DelegatorElement delegatorInfo = EntityConfig.getInstance().getDelegator(delegatorName); if (delegatorInfo == null) { throw new GenericEntityConfException("Could not find a delegator with the name " + delegatorName); @@ -104,7 +104,7 @@ public class ModelReader implements Seri resourceHandlerEntities = new HashMap<ResourceHandler, Collection<String>>(); entityResourceHandlerMap = new HashMap<String, ResourceHandler>(); - EntityModelReader entityModelReaderInfo = EntityConfigUtil.getEntityModelReader(modelName); + EntityModelReader entityModelReaderInfo = EntityConfig.getInstance().getEntityModelReader(modelName); if (entityModelReaderInfo == null) { throw new GenericEntityConfException("Cound not find an entity-model-reader with the name " + modelName); @@ -112,7 +112,7 @@ public class ModelReader implements Seri // get all of the main resource model stuff, ie specified in the entityengine.xml file for (Resource resourceElement : entityModelReaderInfo.getResourceList()) { - ResourceHandler handler = new MainResourceHandler(EntityConfigUtil.ENTITY_ENGINE_XML_FILENAME, resourceElement.getLoader(), resourceElement.getLocation()); + ResourceHandler handler = new MainResourceHandler(EntityConfig.ENTITY_ENGINE_XML_FILENAME, resourceElement.getLoader(), resourceElement.getLocation()); entityResourceHandlers.add(handler); } @@ -463,7 +463,7 @@ TEMP_VIEW_LOOP: } public void addEntityToResourceHandler(String entityName, String loaderName, String location) { - entityResourceHandlerMap.put(entityName, new MainResourceHandler(EntityConfigUtil.ENTITY_ENGINE_XML_FILENAME, loaderName, location)); + entityResourceHandlerMap.put(entityName, new MainResourceHandler(EntityConfig.ENTITY_ENGINE_XML_FILENAME, loaderName, location)); } public ResourceHandler getEntityResourceHandler(String entityName) { Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java Sat Aug 23 07:03:04 2014 @@ -46,8 +46,8 @@ import org.ofbiz.entity.condition.Entity import org.ofbiz.entity.condition.EntityConditionList; import org.ofbiz.entity.condition.EntityExpr; import org.ofbiz.entity.condition.EntityOperator; -import org.ofbiz.entity.config.EntityConfigUtil; import org.ofbiz.entity.config.model.Datasource; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.model.ModelEntity; import org.ofbiz.entity.model.ModelField; import org.ofbiz.entity.testtools.EntityTestCase; @@ -461,7 +461,7 @@ public class EntityTestSuite extends Ent public void testForeignKeyCreate() { try { String helperName = delegator.getEntityHelper("Testing").getHelperName(); - Datasource datasourceInfo = EntityConfigUtil.getDatasource(helperName); + Datasource datasourceInfo = EntityConfig.getDatasource(helperName); if (!datasourceInfo.getUseForeignKeys()) { Debug.logInfo("Datasource " + datasourceInfo.getName() + " use-foreign-keys set to false, skipping testForeignKeyCreate", module); return; @@ -485,7 +485,7 @@ public class EntityTestSuite extends Ent public void testForeignKeyRemove() throws Exception { try { String helperName = delegator.getEntityHelper("TestingNode").getHelperName(); - Datasource datasourceInfo = EntityConfigUtil.getDatasource(helperName); + Datasource datasourceInfo = EntityConfig.getDatasource(helperName); if (!datasourceInfo.getUseForeignKeys()) { Debug.logInfo("Datasource " + datasourceInfo.getName() + " use-foreign-keys set to false, skipping testForeignKeyRemove", module); return; @@ -857,7 +857,7 @@ public class EntityTestSuite extends Ent */ /*public void testLimitOffsetOptions() throws Exception { String entityName = "Content"; - Datasource datasourceInfo = EntityConfigUtil.getDatasource(delegator.getEntityHelper(entityName).getHelperName()); + Datasource datasourceInfo = EntityConfig.getDatasource(delegator.getEntityHelper(entityName).getHelperName()); if (UtilValidate.isEmpty(datasourceInfo.offsetStyle) || datasourceInfo.offsetStyle.equals("none")) { Debug.logInfo("The offset-stype configured in datasource is " + datasourceInfo.offsetStyle + ", this test is skipped.", module); return; Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/DumbFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/DumbFactory.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/DumbFactory.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/DumbFactory.java Sat Aug 23 07:03:04 2014 @@ -35,7 +35,7 @@ import javax.transaction.UserTransaction import org.ofbiz.base.util.Debug; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.config.model.Datasource; -import org.ofbiz.entity.config.EntityConfigUtil; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.datasource.GenericHelperInfo; import org.ofbiz.entity.jdbc.ConnectionFactory; @@ -108,7 +108,7 @@ public class DumbFactory implements Tran } public Connection getConnection(GenericHelperInfo helperInfo) throws SQLException, GenericEntityException { - Datasource datasourceInfo = EntityConfigUtil.getDatasource(helperInfo.getHelperBaseName()); + Datasource datasourceInfo = EntityConfig.getDatasource(helperInfo.getHelperBaseName()); if (datasourceInfo.getInlineJdbc() != null) { Connection otherCon = ConnectionFactory.getManagedConnection(helperInfo, datasourceInfo.getInlineJdbc()); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/JNDIFactory.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/JNDIFactory.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/JNDIFactory.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/JNDIFactory.java Sat Aug 23 07:03:04 2014 @@ -38,10 +38,8 @@ import org.ofbiz.base.util.JNDIContextFa import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.config.model.*; -import org.ofbiz.entity.config.EntityConfigUtil; import org.ofbiz.entity.datasource.GenericHelperInfo; import org.ofbiz.entity.jdbc.ConnectionFactory; -import org.w3c.dom.Element; /** * Central source for Tyrex JTA objects from JNDI @@ -63,8 +61,8 @@ public class JNDIFactory implements Tran // try again inside the synch just in case someone when through while we were waiting if (transactionManager == null) { try { - String jndiName = EntityConfigUtil.getTxFactoryTxMgrJndiName(); - String jndiServerName = EntityConfigUtil.getTxFactoryTxMgrJndiServerName(); + String jndiName = EntityConfig.getInstance().getTransactionFactory().getTransactionManagerJndi().getJndiName(); + String jndiServerName = EntityConfig.getInstance().getTransactionFactory().getTransactionManagerJndi().getJndiServerName(); if (UtilValidate.isNotEmpty(jndiName)) { // if (Debug.verboseOn()) Debug.logVerbose("[JNDIFactory.getTransactionManager] Trying JNDI name " + jndiName, module); @@ -99,8 +97,8 @@ public class JNDIFactory implements Tran // try again inside the synch just in case someone when through while we were waiting if (userTransaction == null) { try { - String jndiName = EntityConfigUtil.getTxFactoryUserTxJndiName(); - String jndiServerName = EntityConfigUtil.getTxFactoryUserTxJndiServerName(); + String jndiName = EntityConfig.getInstance().getTransactionFactory().getUserTransactionJndi().getJndiName(); + String jndiServerName = EntityConfig.getInstance().getTransactionFactory().getUserTransactionJndi().getJndiServerName(); if (UtilValidate.isNotEmpty(jndiName)) { // if (Debug.verboseOn()) Debug.logVerbose("[JNDIFactory.getTransactionManager] Trying JNDI name " + jndiName, module); @@ -134,7 +132,7 @@ public class JNDIFactory implements Tran } public Connection getConnection(GenericHelperInfo helperInfo) throws SQLException, GenericEntityException { - Datasource datasourceInfo = EntityConfigUtil.getDatasource(helperInfo.getHelperBaseName()); + Datasource datasourceInfo = EntityConfig.getDatasource(helperInfo.getHelperBaseName()); if (datasourceInfo.getJndiJdbc() != null) { JndiJdbc jndiJdbcElement = datasourceInfo.getJndiJdbc(); Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/TransactionFactoryLoader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/TransactionFactoryLoader.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/TransactionFactoryLoader.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/TransactionFactoryLoader.java Sat Aug 23 07:03:04 2014 @@ -20,7 +20,7 @@ package org.ofbiz.entity.transaction; import org.ofbiz.base.util.Debug; import org.ofbiz.entity.GenericEntityConfException; -import org.ofbiz.entity.config.EntityConfigUtil; +import org.ofbiz.entity.config.model.EntityConfig; /** * TransactionFactoryLoader - utility class that loads the transaction manager and provides to client code a reference to it (TransactionFactoryInterface) @@ -33,7 +33,7 @@ public class TransactionFactoryLoader { private static TransactionFactoryInterface createTransactionFactoryInterface() { TransactionFactoryInterface instance = null; try { - String className = EntityConfigUtil.getTxFactoryClass(); + String className = EntityConfig.getInstance().getTransactionFactory().getClassName(); if (className == null) { throw new IllegalStateException("Could not find transaction factory class name definition"); } Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java Sat Aug 23 07:03:04 2014 @@ -51,8 +51,8 @@ import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericEntityConfException; import org.ofbiz.entity.GenericEntityException; -import org.ofbiz.entity.config.EntityConfigUtil; import org.ofbiz.entity.config.model.Datasource; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.datasource.GenericHelperInfo; import org.ofbiz.entity.jdbc.CursorConnection; @@ -172,7 +172,7 @@ public class TransactionUtil implements setTransactionBeginStack(); // initialize the debug resource - if (EntityConfigUtil.isDebugXAResource()) { + if (debugResources()) { DebugXaResource dxa = new DebugXaResource(); try { dxa.enlist(); @@ -542,12 +542,12 @@ public class TransactionUtil implements } public static boolean debugResources() throws GenericEntityConfException { - return EntityConfigUtil.isDebugXAResource(); + return EntityConfig.getInstance().getDebugXaResources().getValue(); } public static void logRunningTx() { try { - if (EntityConfigUtil.isDebugXAResource()) { + if (debugResources()) { if (UtilValidate.isNotEmpty(debugResMap)) { for (DebugXaResource dxa: debugResMap.values()) { dxa.log(); @@ -1056,7 +1056,7 @@ public class TransactionUtil implements } public static Connection getCursorConnection(GenericHelperInfo helperInfo, Connection con) { - Datasource datasourceInfo = EntityConfigUtil.getDatasource(helperInfo.getHelperBaseName()); + Datasource datasourceInfo = EntityConfig.getDatasource(helperInfo.getHelperBaseName()); if (datasourceInfo == null) { Debug.logWarning("Could not find configuration for " + helperInfo.getHelperBaseName() + " datasource.", module); return con; Modified: ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java URL: http://svn.apache.org/viewvc/ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java?rev=1619976&r1=1619975&r2=1619976&view=diff ============================================================================== --- ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java (original) +++ ofbiz/branches/framework-api-cleanup/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java Sat Aug 23 07:03:04 2014 @@ -36,8 +36,8 @@ import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityConfException; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; -import org.ofbiz.entity.config.EntityConfigUtil; import org.ofbiz.entity.config.model.Datasource; +import org.ofbiz.entity.config.model.EntityConfig; import org.ofbiz.entity.config.model.EntityDataReader; import org.ofbiz.entity.config.model.ReadData; import org.ofbiz.entity.config.model.Resource; @@ -58,7 +58,7 @@ public class EntityDataLoader { public static String getPathsString(String helperName) { StringBuilder pathBuffer = new StringBuilder(); if (UtilValidate.isNotEmpty(helperName)) { - Datasource datasourceInfo = EntityConfigUtil.getDatasource(helperName); + Datasource datasourceInfo = EntityConfig.getDatasource(helperName); for (SqlLoadPath sqlLoadPath : datasourceInfo.getSqlLoadPathList()) { String prependEnv = sqlLoadPath.getPrependEnv(); pathBuffer.append(pathBuffer.length() == 0 ? "" : ";"); @@ -73,12 +73,12 @@ public class EntityDataLoader { } public static List<URL> getUrlList(String helperName) { - Datasource datasourceInfo = EntityConfigUtil.getDatasource(helperName); + Datasource datasourceInfo = EntityConfig.getDatasource(helperName); return getUrlList(helperName, null, datasourceInfo.getReadDataList()); } public static List<URL> getUrlList(String helperName, String componentName) { - Datasource datasourceInfo = EntityConfigUtil.getDatasource(helperName); + Datasource datasourceInfo = EntityConfig.getDatasource(helperName); return getUrlList(helperName, componentName, datasourceInfo.getReadDataList()); } @@ -113,7 +113,7 @@ public class EntityDataLoader { // get all of the main resource model stuff, ie specified in the entityengine.xml file EntityDataReader entityDataReaderInfo = null; try { - entityDataReaderInfo = EntityConfigUtil.getEntityDataReader(readerName); + entityDataReaderInfo = EntityConfig.getInstance().getEntityDataReader(readerName); if (entityDataReaderInfo == null) { // create a reader name defined at runtime Debug.logInfo("Could not find entity-data-reader named: " + readerName + ". Creating a new reader with this name. ", module); @@ -124,7 +124,7 @@ public class EntityDataLoader { } if (entityDataReaderInfo != null) { for (Resource resourceElement: entityDataReaderInfo.getResourceList()) { - ResourceHandler handler = new MainResourceHandler(EntityConfigUtil.ENTITY_ENGINE_XML_FILENAME, resourceElement.getLoader(), resourceElement.getLocation()); + ResourceHandler handler = new MainResourceHandler(EntityConfig.ENTITY_ENGINE_XML_FILENAME, resourceElement.getLoader(), resourceElement.getLocation()); try { urlList.add(handler.getURL()); } catch (GenericConfigException e) { @@ -205,7 +205,7 @@ public class EntityDataLoader { } public static List<URL> getUrlByComponentList(String helperName, List<String> components) { - Datasource datasourceInfo = EntityConfigUtil.getDatasource(helperName); + Datasource datasourceInfo = EntityConfig.getDatasource(helperName); List<String> readerNames = new LinkedList<String>(); for (ReadData readerInfo : datasourceInfo.getReadDataList()) { String readerName = readerInfo.getReaderName(); |
Free forum by Nabble | Edit this page |