Author: adrianc
Date: Sat Aug 30 12:01:45 2014 New Revision: 1621448 URL: http://svn.apache.org/r1621448 Log: Move some GenericDelegator static methods to the Delegator interface. Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java?rev=1621448&r1=1621447&r2=1621448&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java Sat Aug 30 12:01:45 2014 @@ -571,8 +571,14 @@ public interface Delegator { Cache getCache(); + String getCurrentSessionIdentifier(); + + String getCurrentUserIdentifier(); + String getDelegatorName(); + String getDelegatorBaseName(); + String getDelegatorTenantId(); <T> EntityEcaHandler<T> getEntityEcaHandler(); Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=1621448&r1=1621447&r2=1621448&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Sat Aug 30 12:01:45 2014 @@ -48,7 +48,6 @@ import org.ofbiz.base.util.UtilFormatOut import org.ofbiz.base.util.UtilGenerics; 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.base.util.UtilXml; import org.ofbiz.entity.cache.Cache; @@ -85,7 +84,7 @@ import org.w3c.dom.Node; import org.xml.sax.SAXException; /** - * Generic Data Source Delegator Class + * The default implementation of the <code>Delegator</code> interface. * */ public class GenericDelegator implements Delegator { @@ -131,11 +130,6 @@ public class GenericDelegator implements return curValList; } - public static String getCurrentUserIdentifier() { - List<String> curValList = getUserIdentifierStack(); - return curValList.size() > 0 ? curValList.get(0) : null; - } - public static void pushUserIdentifier(String userIdentifier) { if (userIdentifier == null) { return; @@ -167,11 +161,6 @@ public class GenericDelegator implements return curValList; } - public static String getCurrentSessionIdentifier() { - List<String> curValList = getSessionIdentifierStack(); - return curValList.size() > 0 ? curValList.get(0) : null; - } - public static void pushSessionIdentifier(String sessionIdentifier) { if (sessionIdentifier == null) { return; @@ -2982,4 +2971,16 @@ public class GenericDelegator implements public boolean useDistributedCacheClear() { return this.delegatorInfo.getDistributedCacheClearEnabled(); } + + @Override + public String getCurrentSessionIdentifier() { + List<String> curValList = getSessionIdentifierStack(); + return curValList.size() > 0 ? curValList.get(0) : null; + } + + @Override + public String getCurrentUserIdentifier() { + List<String> curValList = getUserIdentifierStack(); + return curValList.size() > 0 ? curValList.get(0) : null; + } } |
Free forum by Nabble | Edit this page |