You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wink.apache.org by "Bryant Luk (JIRA)" <ji...@apache.org> on 2009/09/09 18:06:57 UTC

[jira] Created: (WINK-174) Improve the configuration model to allow pluggable properties loading

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.2
            Reporter: Bryant Luk
             Fix For: 0.2


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.


[jira] Commented: (WINK-174) Improve the configuration model to allow pluggable properties loading

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WINK-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836921#action_12836921 ] 

Hudson commented on WINK-174:
-----------------------------

Integrated in Wink-Trunk-JDK1.5 #268 (See [http://hudson.zones.apache.org/hudson/job/Wink-Trunk-JDK1.5/268/])
    : allow pluggable and JVM property overrides


> 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
>            Assignee: Bryant Luk
>         Attachments: WINK-174.patch, WINK-174_2.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.


[jira] Updated: (WINK-174) Improve the configuration model to allow pluggable properties loading

Posted by "Wendy Raschke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WINK-174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wendy Raschke updated WINK-174:
-------------------------------

    Attachment: WINK-174.patch

Sorry for the confusion--I accidentally named the patch after an existing one that I had on my filesystem (Mike R.'s previous one). I just renamed the file--no other changes.

> 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, 0.2
>            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.


[jira] Commented: (WINK-174) Improve the configuration model to allow pluggable properties loading

Posted by "Wendy Raschke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WINK-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763765#action_12763765 ] 

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

I've done something like what Bryant describes in the WebSphere code that integrates with the Axis2 engine.

I think these system JVM properties can be read and set this way (class names, variables, and methods are all hypothetical at this point. Names have been changed to protect the innocent :):

- Add a new utility class WinkSystemProperties.
- WinkSystemProperties contains a static class variable props, of type Properties.
- WinkSystemProperties contains a static method called getSystemProperties(). It can walk through all of the properties defined in wink-default.properties.
   |--> call method getProperty() for each of these properties, which reads a system property (obvious, I guess). 
- Back in getSystemProperties(), if newly read property is non-null, add to the Properties variable. This method returns that variable.
- RestServlet.getProperties() calls WinkSystemProperties.getSystemProperties()
  |--> If returned Properties map is empty, don't do anything with it.
  |--> If not empty, set on the DeploymentConfiguration object.

This is just a rough idea.

I am not certain if it's valid practice for users to modify the wink-default.properties file. If it is, I wouldn't want to override whatever they put it in there.


> 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, 0.2
>            Reporter: Bryant Luk
>
> 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.


[jira] Assigned: (WINK-174) Improve the configuration model to allow pluggable properties loading

Posted by "Bryant Luk (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WINK-174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryant Luk reassigned WINK-174:
-------------------------------

    Assignee: Bryant Luk

> 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
>            Assignee: 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.


[jira] Updated: (WINK-174) Improve the configuration model to allow pluggable properties loading

Posted by "Wendy Raschke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WINK-174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wendy Raschke updated WINK-174:
-------------------------------

    Attachment: WINK-211.patch

The logging might be too excessive. Regardless of whether property is defined in the configuration file or on JVM, this prints out  property name and value.

> 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, 0.2
>            Reporter: Bryant Luk
>         Attachments: WINK-211.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.


[jira] Commented: (WINK-174) Improve the configuration model to allow pluggable properties loading

Posted by "Wendy Raschke (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (WINK-174) Improve the configuration model to allow pluggable properties loading

Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WINK-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836904#action_12836904 ] 

Mike Rheinheimer commented on WINK-174:
---------------------------------------

Committed in SVN rev 915056.  Thanks Wendy for the production code, me for the RestServletTest, and Bryant for the many WinkSystemProperties*Tests.

> 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
>            Assignee: Bryant Luk
>         Attachments: WINK-174.patch, WINK-174_2.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.


[jira] Resolved: (WINK-174) Improve the configuration model to allow pluggable properties loading

Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WINK-174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Rheinheimer resolved WINK-174.
-----------------------------------

    Resolution: Fixed
      Assignee: Mike Rheinheimer  (was: Bryant Luk)

> 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
>            Assignee: Mike Rheinheimer
>         Attachments: WINK-174.patch, WINK-174_2.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.


[jira] Closed: (WINK-174) Improve the configuration model to allow pluggable properties loading

Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WINK-174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Rheinheimer closed WINK-174.
---------------------------------


Issue is resolved.  Closing per Bryant's approval to do so.

> 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
>            Assignee: Mike Rheinheimer
>         Attachments: WINK-174.patch, WINK-174_2.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.


[jira] Updated: (WINK-174) Improve the configuration model to allow pluggable properties loading

Posted by "Wendy Raschke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WINK-174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wendy Raschke updated WINK-174:
-------------------------------

    Attachment:     (was: WINK-211.patch)

> 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, 0.2
>            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.


[jira] Updated: (WINK-174) Improve the configuration model to allow pluggable properties loading

Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WINK-174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Rheinheimer updated WINK-174:
----------------------------------

    Attachment: WINK-174_2.patch

WINK-174_2.patch has an additional test, and is updated to fit the current code base.

> 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
>            Assignee: Bryant Luk
>         Attachments: WINK-174.patch, WINK-174_2.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.


[jira] Updated: (WINK-174) Improve the configuration model to allow pluggable properties loading

Posted by "Nick Gallardo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WINK-174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Gallardo updated WINK-174:
-------------------------------

    Affects Version/s: 0.1
        Fix Version/s:     (was: 0.2)

> 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, 0.2
>            Reporter: Bryant Luk
>
> 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.


[jira] Commented: (WINK-174) Improve the configuration model to allow pluggable properties loading

Posted by "Bryant Luk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WINK-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767835#action_12767835 ] 

Bryant Luk commented on WINK-174:
---------------------------------

Hi Wendy,

Took a look at this patch this morning.  A few comments:

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

2)  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).

> 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, 0.2
>            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.