You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2013/06/02 07:15:58 UTC

svn commit: r1488643 - in /ofbiz/trunk/framework/service/src/org/ofbiz/service/config: ./ model/

Author: adrianc
Date: Sun Jun  2 05:15:57 2013
New Revision: 1488643

URL: http://svn.apache.org/r1488643
Log:
New models for the serviceengine.xml file. They are not used yet - the ServiceConfigUtil class needs to be updated to use them, as well as other code that uses ServiceConfigUtil. The new models were contributed by Christoph Neuroth and were refactored by me.

https://issues.apache.org/jira/browse/OFBIZ-5204



Added:
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/ServiceConfigException.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Authorization.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Engine.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/GlobalServices.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/JmsService.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Notification.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/NotificationGroup.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Notify.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Parameter.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ResourceLoader.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/RunFromPool.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Server.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceConfig.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEcas.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEngine.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceGroups.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceLocation.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/StartupService.java   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ThreadPool.java   (with props)
Modified:
    ofbiz/trunk/framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/ServiceConfigException.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/ServiceConfigException.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/ServiceConfigException.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/ServiceConfigException.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config;
+
+import org.ofbiz.base.config.GenericConfigException;
+
+/**
+ * Service configuration exception. Thrown when there is a configuration error in the
+ * <code>serviceengine.xml</code> file.
+ */
+@SuppressWarnings("serial")
+public class ServiceConfigException extends GenericConfigException {
+
+    public ServiceConfigException() {
+        super();
+    }
+
+    public ServiceConfigException(String str) {
+        super(str);
+    }
+
+    public ServiceConfigException(String str, Throwable nested) {
+        super(str, nested);
+    }
+}
+

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/ServiceConfigException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/ServiceConfigException.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java?rev=1488643&r1=1488642&r2=1488643&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java Sun Jun  2 05:15:57 2013
@@ -30,6 +30,8 @@ import org.ofbiz.base.config.ResourceLoa
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilXml;
 import org.ofbiz.base.util.cache.UtilCache;
+import org.ofbiz.service.config.model.ServiceConfig;
+import org.ofbiz.service.config.model.ServiceEngine;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -37,13 +39,41 @@ import org.w3c.dom.NodeList;
 /**
  * Misc. utility method for dealing with the serviceengine.xml file
  */
-@SuppressWarnings("serial")
-public class ServiceConfigUtil implements Serializable {
+public final class ServiceConfigUtil {
 
     public static final String module = ServiceConfigUtil.class.getName();
     public static final String engine = "default";
     public static final String SERVICE_ENGINE_XML_FILENAME = "serviceengine.xml";
+    // Remove this cache in the new implementation.
     private static final UtilCache<String, Map<String, NotificationGroup>> notificationGroupCache = UtilCache.createUtilCache("service.NotificationGroups", 0, 0, false);
+    // New Implementation: Create a cache for the ServiceConfig instance - so the configuration can be reloaded at run-time.
+    // There will be only one ServiceConfig instance in the cache.
+    private static final UtilCache<String, ServiceConfig> serviceConfigCache = UtilCache.createUtilCache("service.ServiceConfig", 0, 0, false);
+
+    /**
+     * Returns the <code>ServiceConfig</code> instance.
+     * @throws GenericConfigException
+     */
+    public static ServiceConfig getServiceConfig() throws GenericConfigException {
+        ServiceConfig instance = serviceConfigCache.get("instance");
+        if (instance == null) {
+            Element serviceConfigElement = ResourceLoader.getXmlRootElement(ServiceConfigUtil.SERVICE_ENGINE_XML_FILENAME);
+            instance = ServiceConfig.create(serviceConfigElement);
+            serviceConfigCache.putIfAbsent("instance", instance);
+            instance = serviceConfigCache.get("instance");
+        }
+        return instance;
+    }
+
+    /**
+     * Returns the specified <code>ServiceEngine</code> instance, or <code>null</code>
+     * if the engine does not exist.
+     * 
+     * @throws GenericConfigException
+     */
+    public static ServiceEngine getServiceEngine(String name) throws GenericConfigException {
+        return getServiceConfig().getServiceEngine(name);
+    }
 
     public static Element getXmlRootElement() throws GenericConfigException {
         Element root = ResourceLoader.getXmlRootElement(ServiceConfigUtil.SERVICE_ENGINE_XML_FILENAME);
@@ -160,6 +190,8 @@ public class ServiceConfigUtil implement
         return null;
     }
 
+    // Replace these classes with the new implementation
+
     public static class NotificationGroup implements Serializable {
         protected Notification notification;
         protected List<Notify> notify;
@@ -251,4 +283,6 @@ public class ServiceConfigUtil implement
             }
         }
     }
+
+    private ServiceConfigUtil() {}
 }

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Authorization.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Authorization.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Authorization.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Authorization.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;authorization&gt;</code> element.
+ */
+@ThreadSafe
+public final class Authorization {
+
+    private final String serviceName;
+
+    Authorization(Element authElement) throws ServiceConfigException {
+        String serviceName = authElement.getAttribute("service-name").intern();
+        if (serviceName.isEmpty()) {
+            throw new ServiceConfigException("<authorization> element service-name attribute is empty");
+        }
+        this.serviceName = serviceName;
+    }
+
+    public String getServiceName() {
+        return serviceName;
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Authorization.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Authorization.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Engine.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Engine.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Engine.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Engine.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.base.util.UtilXml;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;engine&gt;</code> element.
+ */
+@ThreadSafe
+public final class Engine {
+
+    private final String className;
+    private final String name;
+    private final List<Parameter> parameters;
+
+    Engine(Element engineElement) throws ServiceConfigException {
+        String name = engineElement.getAttribute("name").intern();
+        if (name.isEmpty()) {
+            throw new ServiceConfigException("<engine> element name attribute is empty");
+        }
+        this.name = name;
+        String className = engineElement.getAttribute("class").intern();
+        if (className.isEmpty()) {
+            throw new ServiceConfigException("<engine> element class attribute is empty");
+        }
+        this.className = className;
+        List<? extends Element> parameterElementList = UtilXml.childElementList(engineElement, "parameter");
+        if (parameterElementList.isEmpty()) {
+            this.parameters = Collections.emptyList();
+        } else {
+            List<Parameter> parameters = new ArrayList<Parameter>(parameterElementList.size());
+            for (Element parameterElement : parameterElementList) {
+                parameters.add(new Parameter(parameterElement));
+            }
+            this.parameters = Collections.unmodifiableList(parameters);
+        }
+    }
+
+    public String getClassName() {
+        return className;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public List<Parameter> getParameters() {
+        return this.parameters;
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Engine.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Engine.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/GlobalServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/GlobalServices.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/GlobalServices.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/GlobalServices.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;global-services&gt;</code> element.
+ */
+@ThreadSafe
+public final class GlobalServices {
+
+    private final String loader;
+    private final String location;
+
+    GlobalServices(Element globalServicesElement) throws ServiceConfigException {
+        String loader = globalServicesElement.getAttribute("loader").intern();
+        if (loader.isEmpty()) {
+            throw new ServiceConfigException("<global-services> element loader attribute is empty");
+        }
+        this.loader = loader;
+        String location = globalServicesElement.getAttribute("location").intern();
+        if (location.isEmpty()) {
+            throw new ServiceConfigException("<global-services> element location attribute is empty");
+        }
+        this.location = location;
+    }
+
+    public String getLoader() {
+        return loader;
+    }
+
+    public String getLocation() {
+        return location;
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/GlobalServices.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/GlobalServices.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/JmsService.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/JmsService.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/JmsService.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/JmsService.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.base.util.UtilXml;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;jms-service&gt;</code> element.
+ */
+@ThreadSafe
+public final class JmsService {
+
+    private final String name;
+    private final String sendMode;
+    private final List<Server> servers;
+
+    JmsService(Element jmsServiceElement) throws ServiceConfigException {
+        String name = jmsServiceElement.getAttribute("name").intern();
+        if (name.isEmpty()) {
+            throw new ServiceConfigException("<jms-service> element name attribute is empty");
+        }
+        this.name = name;
+        String sendMode = jmsServiceElement.getAttribute("send-mode").intern();
+        if (sendMode.isEmpty()) {
+            sendMode = "none";
+        }
+        this.sendMode = sendMode;
+        List<? extends Element> serverElementList = UtilXml.childElementList(jmsServiceElement, "server");
+        if (serverElementList.isEmpty()) {
+            this.servers = Collections.emptyList();
+        } else {
+            List<Server> servers = new ArrayList<Server>(serverElementList.size());
+            for (Element serverElement : serverElementList) {
+                servers.add(new Server(serverElement));
+            }
+            this.servers = Collections.unmodifiableList(servers);
+        }
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getSendMode() {
+        return this.sendMode;
+    }
+
+    public List<Server> getServers() {
+        return this.servers;
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/JmsService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/JmsService.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Notification.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Notification.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Notification.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Notification.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;notification&gt;</code> element.
+ */
+@ThreadSafe
+public final class Notification {
+
+    private final String screen;
+    private final String service;
+    private final String subject;
+
+    Notification(Element notificationElement) throws ServiceConfigException {
+        String subject = notificationElement.getAttribute("subject").intern();
+        if (subject.isEmpty()) {
+            throw new ServiceConfigException("<notification> element subject attribute is empty");
+        }
+        this.subject = subject;
+        String screen = notificationElement.getAttribute("screen").intern();
+        if (subject.isEmpty()) {
+            throw new ServiceConfigException("<notification> element screen attribute is empty");
+        }
+        this.screen = screen;
+        String service = notificationElement.getAttribute("service").intern();
+        if (service.isEmpty()) {
+            service = "sendMailFromScreen";
+        }
+        this.service = service;
+        
+    }
+
+    public String getScreen() {
+        return screen;
+    }
+
+    public String getService() {
+        return this.service;
+    }
+
+    public String getSubject() {
+        return subject;
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Notification.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Notification.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/NotificationGroup.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/NotificationGroup.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/NotificationGroup.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/NotificationGroup.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.base.util.UtilXml;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;notification-group&gt;</code> element.
+ */
+@ThreadSafe
+public final class NotificationGroup {
+
+    private final String name;
+    private final Notification notification;
+    private final List<Notify> notifyList;
+
+    NotificationGroup(Element notificationGroupElement) throws ServiceConfigException {
+        this.name = notificationGroupElement.getAttribute("name").intern();
+        Element notification = UtilXml.firstChildElement(notificationGroupElement, "notification");
+        if (notification == null) {
+            throw new ServiceConfigException("<notification> element is missing");
+        }
+        this.notification = new Notification(notification);
+        List<? extends Element> notifyElementList = UtilXml.childElementList(notificationGroupElement, "notify");
+        if (notifyElementList.size() < 2) {
+            throw new ServiceConfigException("<notify> element(s) missing");
+        } else {
+            List<Notify> notifyList = new ArrayList<Notify>(notifyElementList.size());
+            for (Element notifyElement : notifyElementList) {
+                notifyList.add(new Notify(notifyElement));
+            }
+            this.notifyList = Collections.unmodifiableList(notifyList);
+        }
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public Notification getNotification() {
+        return notification;
+    }
+
+    public List<Notify> getNotifyList() {
+        return this.notifyList;
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/NotificationGroup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/NotificationGroup.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Notify.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Notify.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Notify.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Notify.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.base.util.UtilXml;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;notify&gt;</code> element.
+ */
+@ThreadSafe
+public final class Notify {
+
+    private final String content;
+    private final String type;
+
+    Notify(Element notifyElement) throws ServiceConfigException {
+        String type = notifyElement.getAttribute("type").intern();
+        if (type.isEmpty()) {
+            throw new ServiceConfigException("<notify> element type attribute is empty");
+        }
+        this.type = type;
+        String content = UtilXml.elementValue(notifyElement);
+        if (content == null) {
+            content = "";
+        }
+        this.content = content;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Notify.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Notify.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Parameter.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Parameter.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Parameter.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Parameter.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;parameter&gt;</code> element.
+ */
+@ThreadSafe
+public final class Parameter {
+
+    private final String name;
+    private final String value;
+
+    Parameter(Element parameterElement) throws ServiceConfigException {
+        String name = parameterElement.getAttribute("name").intern();
+        if (name.isEmpty()) {
+            throw new ServiceConfigException("<parameter> element name attribute is empty");
+        }
+        this.name = name;
+        String value = parameterElement.getAttribute("value").intern();
+        if (value.isEmpty()) {
+            throw new ServiceConfigException("<parameter> element value attribute is empty");
+        }
+        this.value = value;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getValue() {
+        return value;
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Parameter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Parameter.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ResourceLoader.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ResourceLoader.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ResourceLoader.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ResourceLoader.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;resource-loader&gt;</code> element.
+ */
+@ThreadSafe
+public final class ResourceLoader {
+
+    private final String className;
+    private final String name;
+    private final String prefix;
+    private final String prependEnv;
+
+    ResourceLoader(Element resourceLoaderElement) throws ServiceConfigException {
+        String name = resourceLoaderElement.getAttribute("name").intern();
+        if (name.isEmpty()) {
+            throw new ServiceConfigException("<resource-loader> element name attribute is empty");
+        }
+        this.name = name;
+        String className = resourceLoaderElement.getAttribute("class").intern();
+        if (className.isEmpty()) {
+            throw new ServiceConfigException("<resource-loader> element class attribute is empty");
+        }
+        this.className = className;
+        this.prependEnv = resourceLoaderElement.getAttribute("prepend-env").intern();
+        this.prefix = resourceLoaderElement.getAttribute("prefix").intern();
+    }
+
+    public String getClassName() {
+        return className;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getPrefix() {
+        return prefix;
+    }
+
+    public String getPrependEnv() {
+        return prependEnv;
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ResourceLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ResourceLoader.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/RunFromPool.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/RunFromPool.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/RunFromPool.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/RunFromPool.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;run-from-pool&gt;</code> element.
+ */
+@ThreadSafe
+public final class RunFromPool {
+
+    private final String name;
+
+    RunFromPool(Element runFromPoolElement) throws ServiceConfigException {
+        String name = runFromPoolElement.getAttribute("name").intern();
+        if (name.isEmpty()) {
+            throw new ServiceConfigException("<run-from-pool> element name attribute is empty");
+        }
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/RunFromPool.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/RunFromPool.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Server.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Server.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Server.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Server.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;server&gt;</code> element.
+ */
+@ThreadSafe
+public final class Server {
+
+    private final String clientId;
+    private final String jndiName;
+    private final String jndiServerName;
+    private final String listen;
+    private final String listenerClass;
+    private final String password;
+    private final String topicQueue;
+    private final String type;
+    private final String username;
+
+    Server(Element serverElement) throws ServiceConfigException {
+        String jndiServerName = serverElement.getAttribute("jndi-server-name").intern();
+        if (jndiServerName.isEmpty()) {
+            throw new ServiceConfigException("<server> element jndi-server-name attribute is empty");
+        }
+        this.jndiServerName = jndiServerName;
+        String jndiName = serverElement.getAttribute("jndi-name").intern();
+        if (jndiName.isEmpty()) {
+            throw new ServiceConfigException("<server> element jndi-name attribute is empty");
+        }
+        this.jndiName = jndiName;
+        String topicQueue = serverElement.getAttribute("topic-queue").intern();
+        if (topicQueue.isEmpty()) {
+            throw new ServiceConfigException("<server> element topic-queue attribute is empty");
+        }
+        this.topicQueue = topicQueue;
+        String type = serverElement.getAttribute("type").intern();
+        if (type.isEmpty()) {
+            throw new ServiceConfigException("<server> element type attribute is empty");
+        }
+        this.type = type;
+        this.username = serverElement.getAttribute("username").intern();
+        this.password = serverElement.getAttribute("password").intern();
+        this.clientId = serverElement.getAttribute("client-id").intern();
+        String listen = serverElement.getAttribute("listen").intern();
+        if (listen.isEmpty()) {
+            listen = "false";
+        }
+        this.listen = listen;
+        this.listenerClass = serverElement.getAttribute("listener-class").intern();
+    }
+
+    public String getClientId() {
+        return clientId;
+    }
+
+    public String getJndiName() {
+        return jndiName;
+    }
+
+    public String getJndiServerName() {
+        return jndiServerName;
+    }
+
+    public String getListen() {
+        return listen;
+    }
+
+    public String getListenerClass() {
+        return listenerClass;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public String getTopicQueue() {
+        return topicQueue;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Server.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/Server.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceConfig.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceConfig.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceConfig.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceConfig.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.base.util.UtilXml;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;service-config&gt;</code> element.
+ */
+@ThreadSafe
+public final class ServiceConfig {
+
+    public static ServiceConfig create(Element serviceConfigElement) throws ServiceConfigException {
+        Map<String, ServiceEngine> serviceEngineMap = new HashMap<String, ServiceEngine>();
+        List<? extends Element> engineElementList = UtilXml.childElementList(serviceConfigElement, "service-engine");
+        for (Element engineElement : engineElementList) {
+            ServiceEngine engineModel = new ServiceEngine(engineElement);
+            serviceEngineMap.put(engineModel.getName(), engineModel);
+        }
+        return new ServiceConfig(serviceEngineMap);
+    }
+
+    private final Map<String, ServiceEngine> serviceEngineMap;
+
+    private ServiceConfig(Map<String, ServiceEngine> serviceEngineMap) {
+        this.serviceEngineMap = Collections.unmodifiableMap(serviceEngineMap);
+    }
+
+    public Collection<ServiceEngine> getServiceEngines() {
+        return this.serviceEngineMap.values();
+    }
+
+    public ServiceEngine getServiceEngine(String name) {
+        return this.serviceEngineMap.get(name);
+    }
+
+
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceConfig.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEcas.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEcas.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEcas.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEcas.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;service-ecas&gt;</code> element.
+ */
+@ThreadSafe
+public final class ServiceEcas {
+
+    private final String loader;
+    private final String location;
+
+    ServiceEcas(Element serviceEcasElement) throws ServiceConfigException {
+        String loader = serviceEcasElement.getAttribute("loader").intern();
+        if (loader.isEmpty()) {
+            throw new ServiceConfigException("<service-ecas> element loader attribute is empty");
+        }
+        this.loader = loader;
+        String location = serviceEcasElement.getAttribute("location").intern();
+        if (location.isEmpty()) {
+            throw new ServiceConfigException("<service-ecas> element location attribute is empty");
+        }
+        this.location = location;
+    }
+
+    public String getLoader() {
+        return loader;
+    }
+
+    public String getLocation() {
+        return location;
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEcas.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEcas.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEngine.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEngine.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEngine.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEngine.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.base.util.UtilXml;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;service-engine&gt;</code> element.
+ */
+@ThreadSafe
+public final class ServiceEngine {
+
+    private final Authorization authorization;
+    private final List<Engine> engines;
+    private final List<GlobalServices> globalServices;
+    private final List<JmsService> jmsServices;
+    private final String name;
+    private final List<NotificationGroup> notificationGroups;
+    private final List<ResourceLoader> resourceLoaders;
+    private final List<ServiceEcas> serviceEcas;
+    private final List<ServiceGroups> serviceGroups;
+    private final List<ServiceLocation> serviceLocations;
+    private final List<StartupService> startupServices;
+    private final ThreadPool threadPool;
+
+    ServiceEngine(Element engineElement) throws ServiceConfigException {
+        String name = engineElement.getAttribute("name").intern();
+        if (name.isEmpty()) {
+            throw new ServiceConfigException("<service-engine> element name attribute is empty");
+        }
+        this.name = name;
+        Element authElement = UtilXml.firstChildElement(engineElement, "authorization");
+        if (authElement == null) {
+            throw new ServiceConfigException("<authorization> element is missing");
+        }
+        this.authorization = new Authorization(authElement);
+        Element poolElement = UtilXml.firstChildElement(engineElement, "thread-pool");
+        if (poolElement == null) {
+            throw new ServiceConfigException("<thread-pool> element is missing");
+        }
+        this.threadPool = new ThreadPool(poolElement);
+        List<? extends Element> engineElementList = UtilXml.childElementList(engineElement, "engine");
+        if (engineElementList.isEmpty()) {
+            this.engines = Collections.emptyList();
+        } else {
+            List<Engine> engines = new ArrayList<Engine>(engineElementList.size());
+            for (Element childEngineElement : engineElementList) {
+                engines.add(new Engine(childEngineElement));
+            }
+            this.engines = Collections.unmodifiableList(engines);
+        }
+        List<? extends Element> serviceLocationElementList = UtilXml.childElementList(engineElement, "service-location");
+        if (serviceLocationElementList.isEmpty()) {
+            this.serviceLocations = Collections.emptyList();
+        } else {
+            List<ServiceLocation> serviceLocations = new ArrayList<ServiceLocation>(serviceLocationElementList.size());
+            for (Element serviceLocationElement : serviceLocationElementList) {
+                serviceLocations.add(new ServiceLocation(serviceLocationElement));
+            }
+            this.serviceLocations = Collections.unmodifiableList(serviceLocations);
+        }
+        List<? extends Element> notificationGroupElementList = UtilXml.childElementList(engineElement, "notification-group");
+        if (notificationGroupElementList.isEmpty()) {
+            this.notificationGroups = Collections.emptyList();
+        } else {
+            List<NotificationGroup> notificationGroups = new ArrayList<NotificationGroup>(notificationGroupElementList.size());
+            for (Element notificationGroupElement : notificationGroupElementList) {
+                notificationGroups.add(new NotificationGroup(notificationGroupElement));
+            }
+            this.notificationGroups = Collections.unmodifiableList(notificationGroups);
+        }
+        List<? extends Element> startupServiceElementList = UtilXml.childElementList(engineElement, "startup-service");
+        if (startupServiceElementList.isEmpty()) {
+            this.startupServices = Collections.emptyList();
+        } else {
+            List<StartupService> startupServices = new ArrayList<StartupService>(startupServiceElementList.size());
+            for (Element startupServiceElement : startupServiceElementList) {
+                startupServices.add(new StartupService(startupServiceElement));
+            }
+            this.startupServices = Collections.unmodifiableList(startupServices);
+        }
+        List<? extends Element> resourceLoaderElementList = UtilXml.childElementList(engineElement, "resource-loader");
+        if (resourceLoaderElementList.isEmpty()) {
+            this.resourceLoaders = Collections.emptyList();
+        } else {
+            List<ResourceLoader> resourceLoaders = new ArrayList<ResourceLoader>(resourceLoaderElementList.size());
+            for (Element resourceLoaderElement : resourceLoaderElementList) {
+                resourceLoaders.add(new ResourceLoader(resourceLoaderElement));
+            }
+            this.resourceLoaders = Collections.unmodifiableList(resourceLoaders);
+        }
+        List<? extends Element> globalServicesElementList = UtilXml.childElementList(engineElement, "global-services");
+        if (globalServicesElementList.isEmpty()) {
+            this.globalServices = Collections.emptyList();
+        } else {
+            List<GlobalServices> globalServices = new ArrayList<GlobalServices>(globalServicesElementList.size());
+            for (Element globalServicesElement : globalServicesElementList) {
+                globalServices.add(new GlobalServices(globalServicesElement));
+            }
+            this.globalServices = Collections.unmodifiableList(globalServices);
+        }
+        List<? extends Element> serviceGroupsElementList = UtilXml.childElementList(engineElement, "service-groups");
+        if (serviceGroupsElementList.isEmpty()) {
+            this.serviceGroups = Collections.emptyList();
+        } else {
+            List<ServiceGroups> serviceGroups = new ArrayList<ServiceGroups>(serviceGroupsElementList.size());
+            for (Element serviceGroupsElement : serviceGroupsElementList) {
+                serviceGroups.add(new ServiceGroups(serviceGroupsElement));
+            }
+            this.serviceGroups = Collections.unmodifiableList(serviceGroups);
+        }
+        List<? extends Element> serviceEcasElementList = UtilXml.childElementList(engineElement, "service-ecas");
+        if (serviceEcasElementList.isEmpty()) {
+            this.serviceEcas = Collections.emptyList();
+        } else {
+            List<ServiceEcas> serviceEcas = new ArrayList<ServiceEcas>(serviceEcasElementList.size());
+            for (Element serviceEcasElement : serviceEcasElementList) {
+                serviceEcas.add(new ServiceEcas(serviceEcasElement));
+            }
+            this.serviceEcas = Collections.unmodifiableList(serviceEcas);
+        }
+        List<? extends Element> jmsServiceElementList = UtilXml.childElementList(engineElement, "jms-service");
+        if (jmsServiceElementList.isEmpty()) {
+            this.jmsServices = Collections.emptyList();
+        } else {
+            List<JmsService> jmsServices = new ArrayList<JmsService>(jmsServiceElementList.size());
+            for (Element jmsServiceElement : jmsServiceElementList) {
+                jmsServices.add(new JmsService(jmsServiceElement));
+            }
+            this.jmsServices = Collections.unmodifiableList(jmsServices);
+        }
+    }
+
+    public Authorization getAuthorization() {
+        return authorization;
+    }
+
+    public List<Engine> getEngines() {
+        return this.engines;
+    }
+
+    public List<GlobalServices> getGlobalServices() {
+        return this.globalServices;
+    }
+
+    public List<JmsService> getJmsServices() {
+        return this.jmsServices;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public List<NotificationGroup> getNotificationGroups() {
+        return this.notificationGroups;
+    }
+
+    public List<ResourceLoader> getResourceLoaders() {
+        return this.resourceLoaders;
+    }
+
+    public List<ServiceEcas> getServiceEcas() {
+        return this.serviceEcas;
+    }
+
+    public List<ServiceGroups> getServiceGroups() {
+        return this.serviceGroups;
+    }
+
+    public List<ServiceLocation> getServiceLocations() {
+        return this.serviceLocations;
+    }
+
+    public List<StartupService> getStartupServices() {
+        return this.startupServices;
+    }
+
+    public ThreadPool getThreadPool() {
+        return threadPool;
+    }
+
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEngine.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceEngine.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceGroups.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceGroups.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceGroups.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceGroups.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;service-groups&gt;</code> element.
+ */
+@ThreadSafe
+public final class ServiceGroups {
+
+    private final String loader;
+    private final String location;
+
+    ServiceGroups(Element serviceGroupsElement) throws ServiceConfigException {
+        String loader = serviceGroupsElement.getAttribute("loader").intern();
+        if (loader.isEmpty()) {
+            throw new ServiceConfigException("<service-groups> element loader attribute is empty");
+        }
+        this.loader = loader;
+        String location = serviceGroupsElement.getAttribute("location").intern();
+        if (location.isEmpty()) {
+            throw new ServiceConfigException("<service-groups> element location attribute is empty");
+        }
+        this.location = location;
+    }
+
+    public String getLoader() {
+        return loader;
+    }
+
+    public String getLocation() {
+        return location;
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceGroups.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceGroups.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceLocation.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceLocation.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceLocation.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceLocation.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;service-location&gt;</code> element.
+ */
+@ThreadSafe
+public final class ServiceLocation {
+
+    private final String location;
+    private final String name;
+
+    ServiceLocation(Element serviceLocationElement) throws ServiceConfigException {
+        String name = serviceLocationElement.getAttribute("name").intern();
+        if (name.isEmpty()) {
+            throw new ServiceConfigException("<service-location> element name attribute is empty");
+        }
+        this.name = name;
+        String location = serviceLocationElement.getAttribute("location").intern();
+        if (location.isEmpty()) {
+            throw new ServiceConfigException("<service-location> element location attribute is empty");
+        }
+        this.location = location;
+    }
+
+    public String getLocation() {
+        return location;
+    }
+
+    public String getName() {
+        return name;
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceLocation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ServiceLocation.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/StartupService.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/StartupService.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/StartupService.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/StartupService.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;startup-service&gt;</code> element.
+ */
+@ThreadSafe
+public final class StartupService {
+
+    private final String name;
+    private final String runInPool;
+    private final String runtimeDataId;
+    private final int runtimeDelay;
+
+    StartupService(Element startupServiceElement) throws ServiceConfigException {
+        String name = startupServiceElement.getAttribute("name").intern();
+        if (name.isEmpty()) {
+            throw new ServiceConfigException("<startup-service> element name attribute is empty");
+        }
+        this.name = name;
+        this.runtimeDataId = startupServiceElement.getAttribute("runtime-data-id").intern();
+        String runtimeDelay = startupServiceElement.getAttribute("runtime-delay").intern();
+        if (runtimeDelay.isEmpty()) {
+            this.runtimeDelay = 0;
+        } else {
+            try {
+                this.runtimeDelay = Integer.parseInt(runtimeDelay);
+            } catch (Exception e) {
+                throw new ServiceConfigException("<startup-service> element runtime-delay attribute value is invalid");
+            }
+        }
+        this.runInPool = startupServiceElement.getAttribute("run-in-pool").intern();
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getRunInPool() {
+        return runInPool;
+    }
+
+    public String getRuntimeDataId() {
+        return runtimeDataId;
+    }
+
+    public int getRuntimeDelay() {
+            return runtimeDelay;
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/StartupService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/StartupService.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ThreadPool.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ThreadPool.java?rev=1488643&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ThreadPool.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ThreadPool.java Sun Jun  2 05:15:57 2013
@@ -0,0 +1,175 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.config.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.ofbiz.base.lang.ThreadSafe;
+import org.ofbiz.base.util.UtilXml;
+import org.ofbiz.service.config.ServiceConfigException;
+import org.w3c.dom.Element;
+
+/**
+ * An object that models the <code>&lt;thread-pool&gt;</code> element.
+ */
+@ThreadSafe
+public final class ThreadPool {
+
+    private final int failedRetryMin;
+    private final int jobs;
+    private final int maxThreads;
+    private final int minThreads;
+    private final int pollDbMillis;
+    private final boolean pollEnabled;
+    private final int purgeJobDays;
+    private final List<RunFromPool> runFromPools;
+    private final String sendToPool;
+    private final int ttl;
+
+    ThreadPool(Element poolElement) throws ServiceConfigException {
+        String sendToPool = poolElement.getAttribute("send-to-pool").intern();
+        if (sendToPool.isEmpty()) {
+            throw new ServiceConfigException("<thread-pool> element send-to-pool attribute is empty");
+        }
+        this.sendToPool = sendToPool;
+        String purgeJobDays = poolElement.getAttribute("purge-job-days").intern();
+        if (purgeJobDays.isEmpty()) {
+            this.purgeJobDays = 30;
+        } else {
+            try {
+                this.purgeJobDays = Integer.parseInt(purgeJobDays);
+            } catch (Exception e) {
+                throw new ServiceConfigException("<thread-pool> element purge-job-days attribute value is invalid");
+            }
+        }
+        String failedRetryMin = poolElement.getAttribute("failed-retry-min").intern();
+        if (failedRetryMin.isEmpty()) {
+            this.failedRetryMin = 30;
+        } else {
+            try {
+                this.failedRetryMin = Integer.parseInt(failedRetryMin);
+            } catch (Exception e) {
+                throw new ServiceConfigException("<thread-pool> element failed-retry-min attribute value is invalid");
+            }
+        }
+        String ttl = poolElement.getAttribute("ttl").intern();
+        if (ttl.isEmpty()) {
+            this.ttl = 120000;
+        } else {
+            try {
+                this.ttl = Integer.parseInt(ttl);
+            } catch (Exception e) {
+                throw new ServiceConfigException("<thread-pool> element ttl attribute value is invalid");
+            }
+        }
+        String jobs = poolElement.getAttribute("jobs").intern();
+        if (ttl.isEmpty()) {
+            this.jobs = 100;
+        } else {
+            try {
+                this.jobs = Integer.parseInt(jobs);
+            } catch (Exception e) {
+                throw new ServiceConfigException("<thread-pool> element jobs attribute value is invalid");
+            }
+        }
+        String minThreads = poolElement.getAttribute("min-threads").intern();
+        if (minThreads.isEmpty()) {
+            this.minThreads = 1;
+        } else {
+            try {
+                this.minThreads = Integer.parseInt(minThreads);
+            } catch (Exception e) {
+                throw new ServiceConfigException("<thread-pool> element min-threads attribute value is invalid");
+            }
+        }
+        String maxThreads = poolElement.getAttribute("max-threads").intern();
+        if (maxThreads.isEmpty()) {
+            this.maxThreads = 5;
+        } else {
+            try {
+                this.maxThreads = Integer.parseInt(maxThreads);
+            } catch (Exception e) {
+                throw new ServiceConfigException("<thread-pool> element max-threads attribute value is invalid");
+            }
+        }
+        this.pollEnabled = !"false".equals(poolElement.getAttribute("poll-enabled"));
+        String pollDbMillis = poolElement.getAttribute("poll-db-millis").intern();
+        if (pollDbMillis.isEmpty()) {
+            this.pollDbMillis = 30000;
+        } else {
+            try {
+                this.pollDbMillis = Integer.parseInt(pollDbMillis);
+            } catch (Exception e) {
+                throw new ServiceConfigException("<thread-pool> element poll-db-millis attribute value is invalid");
+            }
+        }
+        List<? extends Element> runFromPoolElementList = UtilXml.childElementList(poolElement, "run-from-pool");
+        if (runFromPoolElementList.isEmpty()) {
+            this.runFromPools = Collections.emptyList();
+        } else {
+            List<RunFromPool> runFromPools = new ArrayList<RunFromPool>(runFromPoolElementList.size());
+            for (Element runFromPoolElement : runFromPoolElementList) {
+                runFromPools.add(new RunFromPool(runFromPoolElement));
+            }
+            this.runFromPools = Collections.unmodifiableList(runFromPools);
+        }
+    }
+
+    public int getFailedRetryMin() {
+        return failedRetryMin;
+    }
+
+    public int getJobs() {
+        return jobs;
+    }
+
+    public int getMaxThreads() {
+        return maxThreads;
+    }
+
+    public int getMinThreads() {
+        return minThreads;
+    }
+
+    public int getPollDbMillis() {
+        return pollDbMillis;
+    }
+
+    public boolean getPollEnabled() {
+        return pollEnabled;
+    }
+
+    public int getPurgeJobDays() {
+        return purgeJobDays;
+    }
+
+    public List<RunFromPool> getRunFromPools() {
+        return this.runFromPools;
+    }
+
+    public String getSendToPool() {
+        return sendToPool;
+    }
+
+    public int getTtl() {
+        return ttl;
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ThreadPool.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/config/model/ThreadPool.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL