svn commit: r1867343 - /ofbiz/ofbiz-framework/trunk/framework/start/src/main/java/org/apache/ofbiz/base/start/Start.java

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

svn commit: r1867343 - /ofbiz/ofbiz-framework/trunk/framework/start/src/main/java/org/apache/ofbiz/base/start/Start.java

mthl
Author: mthl
Date: Sun Sep 22 12:56:08 2019
New Revision: 1867343

URL: http://svn.apache.org/viewvc?rev=1867343&view=rev
Log:
Improved: Allow updating the ‘Config’ object of the server instance
(OFBIZ-11203)

When doing some informal tests, it is useful to be able to create
small programs using the OFBiz delegator without requiring every
components to be loaded as done by the ‘Start#main’ static method.

To achieve that with the current singleton based implementation, we
need to instantiate a custom ‘Config’ object and use it as the global
configuration.

Thanks: Samuel Trégouët for your contribution.

Modified:
    ofbiz/ofbiz-framework/trunk/framework/start/src/main/java/org/apache/ofbiz/base/start/Start.java

Modified: ofbiz/ofbiz-framework/trunk/framework/start/src/main/java/org/apache/ofbiz/base/start/Start.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/start/src/main/java/org/apache/ofbiz/base/start/Start.java?rev=1867343&r1=1867342&r2=1867343&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/start/src/main/java/org/apache/ofbiz/base/start/Start.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/start/src/main/java/org/apache/ofbiz/base/start/Start.java Sun Sep 22 12:56:08 2019
@@ -110,6 +110,15 @@ public final class Start {
     }
 
     /**
+     * Updates the server's main configuration.
+     *
+     * @param c  the new configuration
+     */
+    public void setConfig(Config c) {
+        this.config = c;
+    }
+
+    /**
      * Returns the server's current state.
      */
     public ServerState getCurrentState() {