Author: adrianc
Date: Mon Oct 5 01:53:50 2009 New Revision: 821649 URL: http://svn.apache.org/viewvc?rev=821649&view=rev Log: Replaced GenericDelegator.getGenericDelegator(...) calls with new factory method. Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/cache/AbstractCache.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/ListFinder.java ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RmiServiceContainer.java ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceStreamHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavServlet.java ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerContextMapper.java ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/InstanceEntityObject.java ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/requester/AbstractRequester.java ofbiz/trunk/specialpurpose/webpos/src/org/ofbiz/webpos/session/WebPosSession.java ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java Mon Oct 5 01:53:50 2009 @@ -36,7 +36,6 @@ import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilXml; import org.ofbiz.entity.GenericValue; -import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.GenericDispatcher; Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java Mon Oct 5 01:53:50 2009 @@ -26,10 +26,11 @@ import javax.servlet.http.HttpSessionListener; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.webapp.stats.VisitHandler; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.transaction.TransactionUtil; @@ -59,7 +60,11 @@ String delegatorName = (String) session.getAttribute("delegatorName"); Delegator delegator = null; if (UtilValidate.isNotEmpty(delegatorName)) { - delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } if (delegator == null) { Debug.logError("Could not find delegator with delegatorName in session, not saving abandoned cart info.", module); Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Mon Oct 5 01:53:50 2009 @@ -23,7 +23,7 @@ import org.ofbiz.base.util.*; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericPK; import org.ofbiz.entity.GenericValue; @@ -277,7 +277,11 @@ public Delegator getDelegator() { if (delegator == null) { - delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } return delegator; } Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java Mon Oct 5 01:53:50 2009 @@ -39,10 +39,11 @@ import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilFormatOut; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericPK; import org.ofbiz.entity.GenericValue; @@ -2407,7 +2408,11 @@ if (UtilValidate.isEmpty(delegatorName)) { throw new IllegalStateException("Bad delegator name"); } - delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } return delegator; } Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java Mon Oct 5 01:53:50 2009 @@ -34,9 +34,10 @@ import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.UtilFormatOut; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityUtil; @@ -501,7 +502,11 @@ public Delegator getDelegator() { if (_delegator == null) { - _delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + _delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } return _delegator; } Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java Mon Oct 5 01:53:50 2009 @@ -30,10 +30,11 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityUtil; @@ -77,7 +78,11 @@ public Delegator getDelegator() { if (_delegator == null) { - _delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + _delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } return _delegator; } Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java Mon Oct 5 01:53:50 2009 @@ -32,10 +32,11 @@ import org.ofbiz.base.util.UtilFormatOut; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilNumber; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.service.GenericDispatcher; @@ -103,7 +104,11 @@ public Delegator getDelegator() { if (_delegator == null) { - _delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + _delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } return _delegator; } Modified: ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java (original) +++ ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java Mon Oct 5 01:53:50 2009 @@ -37,7 +37,7 @@ import org.ofbiz.base.container.ContainerConfig.Container.Property; import org.ofbiz.base.util.*; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.apache.catalina.Cluster; import org.apache.catalina.Context; @@ -169,7 +169,11 @@ //int debug = ContainerConfig.getPropertyValue(cc, "debug", 0); // grab some global context settings - this.delegator = GenericDelegator.getGenericDelegator(ContainerConfig.getPropertyValue(cc, "delegator-name", "default")); + try { + this.delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, ContainerConfig.getPropertyValue(cc, "delegator-name", "default")); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } this.contextReloadable = ContainerConfig.getPropertyValue(cc, "apps-context-reloadable", false); this.crossContext = ContainerConfig.getPropertyValue(cc, "apps-cross-context", true); this.distribute = ContainerConfig.getPropertyValue(cc, "apps-distributable", true); Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/cache/AbstractCache.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/cache/AbstractCache.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/cache/AbstractCache.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/cache/AbstractCache.java Mon Oct 5 01:53:50 2009 @@ -18,9 +18,11 @@ *******************************************************************************/ package org.ofbiz.entity.cache; +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; public abstract class AbstractCache<K, V> { @@ -31,9 +33,14 @@ this.id = id; } - @SuppressWarnings("deprecation") public Delegator getDelegator() { - return GenericDelegator.getGenericDelegator(delegatorName); + Delegator delegator = null; + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, this.delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, AbstractCache.class.getName()); + } + return delegator; } public void remove(String entityName) { Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java Mon Oct 5 01:53:50 2009 @@ -25,10 +25,11 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.ObjectType; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilValidate; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.EntityCryptoException; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntity; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericModelException; @@ -255,7 +256,11 @@ if (delegator == null) { // this will be the common case for now as the delegator isn't available where we want to do this // we'll cheat a little here and assume the default delegator - delegator = GenericDelegator.getGenericDelegator("default"); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, "default"); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } String fieldName = null; Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/ListFinder.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/ListFinder.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/ListFinder.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/ListFinder.java Mon Oct 5 01:53:50 2009 @@ -28,14 +28,16 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.cache.AbstractCache; import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.entity.finder.EntityFinderUtil.GetAll; import org.ofbiz.entity.finder.EntityFinderUtil.LimitRange; @@ -116,7 +118,6 @@ } @Override - @SuppressWarnings("deprecation") public void runFind(Map<String, Object> context, Delegator delegator) throws GeneralException { String entityName = this.entityNameExdr.expandString(context); String useCacheStr = this.useCacheStrExdr.expandString(context); @@ -138,7 +139,11 @@ resultSetType = ResultSet.TYPE_FORWARD_ONLY; if (delegatorName != null && delegatorName.length() > 0) { - delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, AbstractCache.class.getName()); + } } EntityCondition whereEntityCondition = getWhereEntityCondition(context, modelEntity, delegator.getModelFieldTypeReader(modelEntity)); Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java (original) +++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java Mon Oct 5 01:53:50 2009 @@ -33,10 +33,11 @@ import org.ofbiz.base.container.ContainerException; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.StringUtil; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilURL; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.jdbc.DatabaseUtil; import org.ofbiz.entity.model.ModelEntity; @@ -225,7 +226,12 @@ String delegatorNameToUse = overrideDelegator != null ? overrideDelegator : delegatorName; String groupNameToUse = overrideGroup != null ? overrideGroup : entityGroupName; - Delegator delegator = GenericDelegator.getGenericDelegator(delegatorNameToUse); + Delegator delegator = null; + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorNameToUse); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } if (delegator == null) { throw new ContainerException("Invalid delegator name!"); } Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java (original) +++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java Mon Oct 5 01:53:50 2009 @@ -34,9 +34,10 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntity; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; @@ -149,7 +150,11 @@ // what to do with the delegatorName? this is the delegatorName to use in this service... String delegatorName = (String) context.get("delegatorName"); if (UtilValidate.isNotEmpty(delegatorName)) { - this.delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + this.delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java (original) +++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java Mon Oct 5 01:53:50 2009 @@ -38,11 +38,12 @@ import org.ofbiz.base.util.Debug; import static org.ofbiz.base.util.UtilGenerics.checkList; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.UtilURL; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntity; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; @@ -134,7 +135,11 @@ Delegator delegator = dctx.getDelegator(); String overrideDelegatorName = (String) context.get("delegatorName"); if (UtilValidate.isNotEmpty(overrideDelegatorName)) { - delegator = GenericDelegator.getGenericDelegator(overrideDelegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, overrideDelegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } if (delegator == null) { return ServiceUtil.returnError("Could not find delegator with specified name " + overrideDelegatorName); } Modified: ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java (original) +++ ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java Mon Oct 5 01:53:50 2009 @@ -28,9 +28,11 @@ import org.ofbiz.base.container.Container; import org.ofbiz.base.container.ContainerConfig; import org.ofbiz.base.container.ContainerException; +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.service.GenericDispatcher; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.base.util.UtilProperties; @@ -61,7 +63,12 @@ // get the delegator String delegatorName = ContainerConfig.getPropertyValue(cc, "delegator-name", "default"); - Delegator delegator = GenericDelegator.getGenericDelegator(delegatorName); + Delegator delegator = null; + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } // get the dispatcher String dispatcherName = ContainerConfig.getPropertyValue(cc, "dispatcher-name", "xui-dispatcher"); Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java Mon Oct 5 01:53:50 2009 @@ -22,12 +22,13 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.collections.FlexibleMapAccessor; import org.ofbiz.base.util.string.FlexibleStringExpander; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.entity.finder.EntityFinderUtil.Condition; import org.ofbiz.entity.finder.EntityFinderUtil.ConditionExpr; @@ -102,7 +103,11 @@ String delegatorName = this.delegatorNameExdr.expandString(context); if (delegatorName != null && delegatorName.length() > 0) { - delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } ModelEntity modelEntity = delegator.getModelEntity(entityName); Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityData.java Mon Oct 5 01:53:50 2009 @@ -26,10 +26,11 @@ import org.ofbiz.base.location.FlexibleLocation; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.string.FlexibleStringExpander; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.util.EntityDataAssert; import org.ofbiz.entity.util.EntitySaxReader; import org.ofbiz.minilang.SimpleMethod; @@ -87,7 +88,11 @@ Delegator delegator = methodContext.getDelegator(); if (delegatorName != null && delegatorName.length() > 0) { - delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } URL dataUrl = null; Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java Mon Oct 5 01:53:50 2009 @@ -22,8 +22,9 @@ import java.util.Map; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.condition.EntityCondition; @@ -88,7 +89,11 @@ Delegator delegator = methodContext.getDelegator(); if (delegatorName != null && delegatorName.length() > 0) { - delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } try { Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java Mon Oct 5 01:53:50 2009 @@ -24,9 +24,10 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntity; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.GenericEntityException; @@ -79,7 +80,11 @@ Delegator delegator = methodContext.getDelegator(); if (delegatorName != null && delegatorName.length() > 0) { - delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } Map<String, ? extends Object> inMap = mapAcsr.get(methodContext); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java Mon Oct 5 01:53:50 2009 @@ -30,11 +30,13 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralRuntimeException; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilTimer; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.collections.LRUMap; import org.ofbiz.entity.Delegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; @@ -105,7 +107,11 @@ try { Delegator origDelegator = this.delegator; if (!this.delegator.getOriginalDelegatorName().equals(this.delegator.getDelegatorName())) { - origDelegator = GenericDelegator.getGenericDelegator(this.delegator.getOriginalDelegatorName()); + try { + origDelegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, this.delegator.getOriginalDelegatorName()); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } this.jm = JobManager.getInstance(origDelegator, enableJM); } catch (GeneralRuntimeException e) { Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java Mon Oct 5 01:53:50 2009 @@ -33,10 +33,11 @@ import org.ofbiz.base.container.ContainerConfig; import org.ofbiz.base.container.ContainerException; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.service.GenericDispatcher; @@ -86,7 +87,11 @@ String delegatorName = ContainerConfig.getPropertyValue(cfg, "delegator-name", "default"); this.deleteMail = "true".equals(ContainerConfig.getPropertyValue(cfg, "delete-mail", "false")); - this.delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + this.delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } this.dispatcher = GenericDispatcher.getLocalDispatcher(dispatcherName, delegator); this.timerDelay = (long) ContainerConfig.getPropertyValue(cfg, "poll-delay", 300000); this.maxSize = (long) ContainerConfig.getPropertyValue(cfg, "maxSize", 1000000); // maximum size in bytes Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RmiServiceContainer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RmiServiceContainer.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RmiServiceContainer.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/RmiServiceContainer.java Mon Oct 5 01:53:50 2009 @@ -29,8 +29,10 @@ import org.ofbiz.base.container.Container; import org.ofbiz.base.container.ContainerConfig; import org.ofbiz.base.container.ContainerException; +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.service.GenericDispatcher; import org.ofbiz.service.LocalDispatcher; @@ -121,7 +123,12 @@ } // get the delegator for this container - Delegator delegator = GenericDelegator.getGenericDelegator(delegatorProp.value); + Delegator delegator = null; + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorProp.value); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } // create the LocalDispatcher LocalDispatcher dispatcher = GenericDispatcher.getLocalDispatcher(name, delegator); Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java (original) +++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java Mon Oct 5 01:53:50 2009 @@ -31,10 +31,11 @@ import org.ofbiz.base.util.ObjectType; import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.testtools.EntityTestCase; import org.ofbiz.service.GenericDispatcher; import org.ofbiz.service.GenericServiceException; @@ -69,7 +70,11 @@ String uniqueSuffix = "-" + RandomStringUtils.randomAlphanumeric(10); - this.delegator = GenericDelegator.getGenericDelegator(this.originalDelegatorName).makeTestDelegator(this.originalDelegatorName + uniqueSuffix); + try { + this.delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, this.originalDelegatorName).makeTestDelegator(this.originalDelegatorName + uniqueSuffix); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } this.dispatcher = GenericDispatcher.getLocalDispatcher(originalDispatcherName + uniqueSuffix, delegator); for (Element testCaseElement : UtilXml.childElementList(mainElement, UtilMisc.toSet("test-case", "test-group"))) { Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java Mon Oct 5 01:53:50 2009 @@ -51,7 +51,7 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilObject; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.security.Security; import org.ofbiz.security.SecurityConfigurationException; import org.ofbiz.security.SecurityFactory; @@ -330,7 +330,11 @@ delegatorName = "default"; } if (Debug.verboseOn()) Debug.logVerbose("Setup Entity Engine Delegator with name " + delegatorName, module); - delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } config.getServletContext().setAttribute("delegator", delegator); if (delegator == null) { Debug.logError("[ContextFilter.init] ERROR: delegator factory returned null for delegatorName \"" + delegatorName + "\"", module); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java Mon Oct 5 01:53:50 2009 @@ -34,9 +34,11 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilJ2eeCompat; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilTimer; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.transaction.GenericTransactionException; @@ -149,7 +151,11 @@ Delegator delegator = null; String delegatorName = (String) session.getAttribute("delegatorName"); if (UtilValidate.isNotEmpty(delegatorName)) { - delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } if (delegator == null) { delegator = (Delegator) getServletContext().getAttribute("delegator"); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/CoreEvents.java Mon Oct 5 01:53:50 2009 @@ -41,10 +41,11 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilHttp; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntity; import org.ofbiz.entity.GenericValue; import org.ofbiz.security.authz.Authorization; @@ -118,7 +119,12 @@ return "error"; } - Delegator delegator = GenericDelegator.getGenericDelegator(delegatorName); + Delegator delegator = null; + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } if (delegator == null) { String errMsg = UtilProperties.getMessage(CoreEvents.err_resource, "coreEvents.no_delegator_name_defined", locale); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceStreamHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceStreamHandler.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceStreamHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceStreamHandler.java Mon Oct 5 01:53:50 2009 @@ -32,8 +32,9 @@ import javolution.util.FastMap; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.service.GenericDispatcher; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; @@ -53,7 +54,11 @@ public void init(ServletContext context) throws EventHandlerException { String delegatorName = context.getInitParameter("entityDelegatorName"); - this.delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + this.delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } this.dispatcher = GenericDispatcher.getLocalDispatcher(dispatcherName, delegator); } Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java Mon Oct 5 01:53:50 2009 @@ -48,9 +48,10 @@ import org.apache.xmlrpc.server.XmlRpcNoSuchHandlerException; import org.apache.xmlrpc.util.HttpUtil; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericDispatcher; import org.ofbiz.service.GenericServiceException; @@ -75,7 +76,11 @@ public void init(ServletContext context) throws EventHandlerException { String delegatorName = context.getInitParameter("entityDelegatorName"); - this.delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + this.delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } this.dispatcher = GenericDispatcher.getLocalDispatcher(dispatcherName, delegator); this.setHandlerMapping(new ServiceRpcHandler()); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java Mon Oct 5 01:53:50 2009 @@ -32,9 +32,10 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.model.ModelEntity; @@ -354,7 +355,11 @@ public Delegator getDelegator() { if (this.delegator == null) { - this.delegator = GenericDelegator.getGenericDelegator(this.delegatorName); + try { + this.delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, this.delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } // if still null, then we have a problem if (this.delegator == null) { Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java Mon Oct 5 01:53:50 2009 @@ -30,10 +30,11 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.model.ModelEntity; @@ -108,7 +109,11 @@ // first try the session attribute delegatorName String delegatorName = (String) session.getAttribute("delegatorName"); if (UtilValidate.isNotEmpty(delegatorName)) { - delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } // then try the ServletContext attribute delegator, should always be there... @@ -200,7 +205,11 @@ String delegatorName = (String) session.getAttribute("delegatorName"); if (delegator == null && UtilValidate.isNotEmpty(delegatorName)) { - delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } if (delegator == null) { Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavServlet.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavServlet.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavServlet.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavServlet.java Mon Oct 5 01:53:50 2009 @@ -32,8 +32,9 @@ import org.ofbiz.base.util.CachedClassLoader; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.security.Security; import org.ofbiz.security.SecurityFactory; import org.ofbiz.security.authz.Authorization; @@ -68,7 +69,11 @@ Thread.currentThread().setContextClassLoader(loader); ServletContext context = this.getServletContext(); String delegatorName = context.getInitParameter("entityDelegatorName"); - this.delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + this.delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } String dispatcherName = context.getInitParameter("localDispatcherName"); this.dispatcher = GenericDispatcher.getLocalDispatcher(dispatcherName, this.delegator); this.security = SecurityFactory.getInstance(this.delegator); Modified: ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerContextMapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerContextMapper.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerContextMapper.java (original) +++ ofbiz/trunk/framework/webslinger/src/org/ofbiz/webslinger/WebslingerContextMapper.java Mon Oct 5 01:53:50 2009 @@ -31,10 +31,12 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; +import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.cache.Cache; @@ -60,7 +62,11 @@ System.err.println(org.webslinger.commons.vfs.flat.FlatFileProvider.class); servletContext = config.getServletContext(); String delegatorName = servletContext.getInitParameter("entityDelegatorName"); - delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, WebslingerContextMapper.class.getName()); + } String readerFiles = servletContext.getInitParameter("serviceReaderUrls"); if (readerFiles != null) { for (String reader: CollectionUtil.split(readerFiles, ";")) { @@ -104,7 +110,12 @@ @Override protected void initializeContext(WebslingerServletContext context, Layout layout) throws Exception { OfbizLayout ofbizLayout = (OfbizLayout) layout; - GenericDelegator delegator = GenericDelegator.getGenericDelegator(ofbizLayout.delegatorName); + Delegator delegator = null; + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, ofbizLayout.delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, WebslingerContextMapper.class.getName()); + } context.setAttribute("delegator", delegator); context.setAttribute("dispatcher", new WebslingerGenericDispatcher(context, layout.getTarget(), delegator, globalReaderURLs)); context.setAttribute("authz", AuthorizationFactory.getInstance(delegator)); @@ -112,7 +123,7 @@ } protected static final class WebslingerGenericDispatcher extends GenericDispatcher { - protected WebslingerGenericDispatcher(WebslingerServletContext context, String name, GenericDelegator delegator, List<URL> globalReaderURLs) throws IOException { + protected WebslingerGenericDispatcher(WebslingerServletContext context, String name, Delegator delegator, List<URL> globalReaderURLs) throws IOException { ArrayList<URL> readerURLs = new ArrayList<URL>(globalReaderURLs); String readerFiles = context.getInitParameter("serviceReaderUrls"); if (readerFiles != null) { Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java (original) +++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java Mon Oct 5 01:53:50 2009 @@ -57,13 +57,14 @@ import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilPlist; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilURL; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilProperties.UtilResourceBundle; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.model.ModelEntity; @@ -350,7 +351,16 @@ } String groupNameToUse = overrideGroup != null ? overrideGroup : "org.ofbiz"; - Delegator delegator = UtilValidate.isNotEmpty(overrideDelegator) ? GenericDelegator.getGenericDelegator(overrideDelegator) : dctx.getDelegator(); + Delegator delegator = null; + if (UtilValidate.isNotEmpty(overrideDelegator)) { + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, overrideDelegator); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } + } else { + delegator = dctx.getDelegator(); + } String helperName = delegator.getGroupHelperName(groupNameToUse); if (helperName == null) { Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/InstanceEntityObject.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/InstanceEntityObject.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/InstanceEntityObject.java (original) +++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/InstanceEntityObject.java Mon Oct 5 01:53:50 2009 @@ -18,6 +18,9 @@ *******************************************************************************/ package org.ofbiz.shark.instance; +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilObject; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericDelegator; @@ -40,7 +43,11 @@ public Delegator getGenericDelegator() { if (this.delegator == null && delegatorName != null) { - this.delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + this.delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, this.delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } return this.delegator; } Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/requester/AbstractRequester.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/requester/AbstractRequester.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/requester/AbstractRequester.java (original) +++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/requester/AbstractRequester.java Mon Oct 5 01:53:50 2009 @@ -25,12 +25,14 @@ import java.util.HashMap; import java.io.Serializable; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.shark.container.SharkContainer; import org.enhydra.shark.api.client.wfmodel.WfProcessIterator; @@ -147,7 +149,11 @@ protected synchronized Delegator getDelegator() { if (this.delegator == null && this.delegatorName != null) { - this.delegator = GenericDelegator.getGenericDelegator(this.delegatorName); + try { + this.delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, this.delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } return this.delegator; } Modified: ofbiz/trunk/specialpurpose/webpos/src/org/ofbiz/webpos/session/WebPosSession.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/src/org/ofbiz/webpos/session/WebPosSession.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/webpos/src/org/ofbiz/webpos/session/WebPosSession.java (original) +++ ofbiz/trunk/specialpurpose/webpos/src/org/ofbiz/webpos/session/WebPosSession.java Mon Oct 5 01:53:50 2009 @@ -26,9 +26,11 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; @@ -146,7 +148,11 @@ public Delegator getDelegator() { if (UtilValidate.isEmpty(delegator)) { - delegator = GenericDelegator.getGenericDelegator(delegatorName); + try { + delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); + } catch (ClassNotFoundException e) { + Debug.logError(e, module); + } } return delegator; } Modified: ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java?rev=821649&r1=821648&r2=821649&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java (original) +++ ofbiz/trunk/specialpurpose/workflow/src/org/ofbiz/workflow/definition/XpdlReader.java Mon Oct 5 01:53:50 2009 @@ -32,11 +32,12 @@ import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilURL; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; -import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.DelegatorFactory; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.transaction.GenericTransactionException; @@ -1313,7 +1314,7 @@ if (args.length > 0) sampleFileName = args[0]; - List values = readXpdl(UtilURL.fromFilename(sampleFileName), GenericDelegator.getGenericDelegator("default")); + List values = readXpdl(UtilURL.fromFilename(sampleFileName), UtilObject.getObjectFromFactory(DelegatorFactory.class, "default")); Iterator viter = values.iterator(); while (viter.hasNext()) |
Free forum by Nabble | Edit this page |