[ 
https://issues.apache.org/jira/browse/WINK-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768821#action_12768821
 ] 

Wendy Raschke commented on WINK-174:
------------------------------------

Hi, Bryant,

>>  I didn't see where the System Properties are being set back on the 
>> DeploymentConfiguration object.

You're right: what I intended (but omitted) was this:

properties = WinkSystemProperties.loadSystemProperties(properties);

properties is then returned to getProperties(), which is called by 
getDeploymentConfiguration(), where the setting of it takes place on 
DeploymentConfiguration. This was my thinking behind it.

The way that new method is supposed to work, it is not supposed to override any 
properties already found in the configuration file.

>> I think there's an assumption that all the property keys will be defined by 
>> the time WinkSystemProperties is called (i.e. wink-default.properties 
>> contains all the >> properties defined). I'm not entirely sure that's the 
>> case but that can be changed. Some of the properties aren't specified but 
>> they take their defaults in the code
>> (i.e. Properties.getProperty(String name, String defaultValue) is called so 
>> if the property didn't exist, it would be true/false/some value).

As far as I can see in my Eclipse (using the Java search capability) 
RestServlet.getDeploymentConfiguration() is the only place that calls 
RestServlet.getProperties(), and that method calls 
RestServlet.loadProperties(). I thought that this code in getProperties() reads 
the wink-default.properties file:

        Properties defaultProperties = loadProperties(PROPERTIES_DEFAULT_FILE, 
null);
        ...
        String propertiesLocation = getInitParameter(PROPERTIES_INIT_PARAM);
        if (propertiesLocation != null) {
           ...
           return loadProperties(propertiesLocation, defaultProperties);

In RestServlet.loadProperties(), a new Properties obj is created from the 
second argument passed into it, and that is passed into my new method, 
loadSystemProperties(). Within that, if the properties are null, or empty, then 
no harm done, because nothing is set. But, it seems to me that by the code 
snippet shown above, that the properties from wink-default.properties will be 
found, if not with the first call to loadProperties(), then the second. I was 
going by what I saw in my trace. I always saw the properties in the 
configuration file loaded by the time the getProperties() method was finished.





> Improve the configuration model to allow pluggable properties loading
> ---------------------------------------------------------------------
>
>                 Key: WINK-174
>                 URL: https://issues.apache.org/jira/browse/WINK-174
>             Project: Wink
>          Issue Type: Improvement
>          Components: Common
>    Affects Versions: 0.1, 1.0
>            Reporter: Bryant Luk
>         Attachments: WINK-174.patch
>
>
> While loading properties from the configuration file is good, it would also 
> be nice to support global toggles via system JVM properties (or maybe other 
> configuration methods) without requiring a re-packaging of Apache Wink.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to