svn commit: r429590 - in /incubator/ofbiz/trunk/framework/service/src/org/ofbiz/service: group/ServiceGroupReader.java mail/ServiceMcaUtil.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r429590 - in /incubator/ofbiz/trunk/framework/service/src/org/ofbiz/service: group/ServiceGroupReader.java mail/ServiceMcaUtil.java

jonesde
Author: jonesde
Date: Mon Aug  7 22:50:27 2006
New Revision: 429590

URL: http://svn.apache.org/viewvc?rev=429590&view=rev
Log:
This should fix the MCA reload problem reported by Scott Gray; Apache Jira #OFBIZ-139

Modified:
    incubator/ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupReader.java
    incubator/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java

Modified: incubator/ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupReader.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupReader.java?rev=429590&r1=429589&r2=429590&view=diff
==============================================================================
--- incubator/ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupReader.java (original)
+++ incubator/ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupReader.java Mon Aug  7 22:50:27 2006
@@ -99,8 +99,9 @@
     }
 
     public static GroupModel getGroupModel(String serviceName) {
-        if (groupsCache.size() == 0)
+        if (groupsCache.size() == 0) {
             ServiceGroupReader.readConfig();
+        }
         return (GroupModel) groupsCache.get(serviceName);
     }
 }

Modified: incubator/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java?rev=429590&r1=429589&r2=429590&view=diff
==============================================================================
--- incubator/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java (original)
+++ incubator/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java Mon Aug  7 22:50:27 2006
@@ -98,25 +98,25 @@
         }
 
         if (Debug.importantOn()) {
- String resourceLocation = handler.getLocation();
- try {
- resourceLocation = handler.getURL().toExternalForm();
- } catch (GenericConfigException e) {
- Debug.logError(e, "Could not get resource URL", module);
- }
- Debug.logImportant("Loaded " + numDefs + " Service MCA definitions from " + resourceLocation, module);
+            String resourceLocation = handler.getLocation();
+            try {
+                resourceLocation = handler.getURL().toExternalForm();
+            } catch (GenericConfigException e) {
+                Debug.logError(e, "Could not get resource URL", module);
+            }
+            Debug.logImportant("Loaded " + numDefs + " Service MCA definitions from " + resourceLocation, module);
         }
     }
 
-    public static Collection getServiceMcaRules() {
-        if (mcaCache != null) {
-            return mcaCache.values();
-        }
-        return null;
+    public static List getServiceMcaRules() {
+ if (mcaCache.size() == 0) {
+    readConfig();
+ }
+        return mcaCache.values();
     }
 
     public static void evalRules(LocalDispatcher dispatcher, MimeMessageWrapper wrapper, GenericValue userLogin) throws GenericServiceException {
-        List rules = mcaCache.values();
+        List rules = getServiceMcaRules();
         Set actionsRun = new TreeSet();
         if (rules != null) {
             Iterator i = rules.iterator();