Permalink
Browse files

Made watchForConfigChanges public and updated docs

  • Loading branch information...
1 parent fc25d4e commit 263062f3680c3998054f0978b2c6891e46f997e0 Loren West committed with Loren West Aug 2, 2011
View
@@ -0,0 +1 @@
+.project
View
@@ -2,5 +2,5 @@
"Customers": {
"dbName": "override_from_runtime_json"
},
- "watchThisValue": 64603
+ "watchThisValue": 54293
}
@@ -4,11 +4,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>test 1-protected-test.js </title>
- <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1310429649.26" />
- <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1310429649.26" />
+ <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1312274888.61" />
+ <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1312274888.61" />
- <script type="text/javascript" src="assets/api-js?stamp=1310429649.26"></script>
- <script type="text/javascript" src="assets/ac-js?stamp=1310429649.26"></script>
+ <script type="text/javascript" src="assets/api-js?stamp=1312274888.61"></script>
+ <script type="text/javascript" src="assets/ac-js?stamp=1312274888.61"></script>
</head>
<body id="node-monitor">
@@ -407,7 +407,7 @@
<div id="ft">
<hr />
Released on <a href="https://github.com/lorenwest/node-config">github</a> under the <a href="https://github.com/lorenwest/node-config/blob/master/LICENSE">Apache License 2.0</a>
-<span class="subtitle">version 0.4.2</span>
+<span class="subtitle">version 0.4.3</span>
</div>
</div>
<script type="text/javascript">
@@ -4,11 +4,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>test 2-config-test.js </title>
- <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1310429649.26" />
- <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1310429649.26" />
+ <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1312274888.61" />
+ <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1312274888.61" />
- <script type="text/javascript" src="assets/api-js?stamp=1310429649.26"></script>
- <script type="text/javascript" src="assets/ac-js?stamp=1310429649.26"></script>
+ <script type="text/javascript" src="assets/api-js?stamp=1312274888.61"></script>
+ <script type="text/javascript" src="assets/ac-js?stamp=1312274888.61"></script>
</head>
<body id="node-monitor">
@@ -150,7 +150,7 @@
<span class="p">}</span>
<span class="p">},</span>
- <span class="s1">&#39;Change Notification Tests&#39;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s1">&#39;Internal Change Notification Tests&#39;</span><span class="o">:</span> <span class="p">{</span>
<span class="nx">topic</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="c1">// Attach this topic as a watcher</span>
@@ -191,7 +191,7 @@
<span class="nx">assert</span><span class="p">.</span><span class="nx">equal</span><span class="p">(</span><span class="nx">CONFIG</span><span class="p">.</span><span class="nx">watchThisValue</span><span class="p">,</span> <span class="nx">newWatchedValue</span><span class="p">);</span>
<span class="p">},</span>
- <span class="s1">&#39;waiting for O/S change notification...&#39;</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="nx">obj</span><span class="p">)</span> <span class="p">{</span>
+ <span class="s1">&#39;Waiting for the O/S to notify us of changes...&#39;</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="nx">obj</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// This is just a message for the next test</span>
<span class="nx">assert</span><span class="p">.</span><span class="nx">isTrue</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
<span class="p">}</span>
@@ -206,7 +206,7 @@
<span class="nx">t</span><span class="p">.</span><span class="nx">callback</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="nx">CONFIG</span><span class="p">.</span><span class="nx">_parseFile</span><span class="p">(</span><span class="nx">runtimeJsonFilename</span><span class="p">));</span>
<span class="p">});</span>
<span class="p">},</span>
- <span class="s1">&#39;The O/S notified us of the configuration file change&#39;</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="nx">runtimeObj</span><span class="p">)</span> <span class="p">{</span>
+ <span class="s1">&#39;The runtime.json file was changed&#39;</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="nx">runtimeObj</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">assert</span><span class="p">.</span><span class="nx">isTrue</span><span class="p">(</span><span class="o">!</span><span class="nx">err</span><span class="p">);</span>
<span class="p">},</span>
<span class="s1">&#39;Prior configuration values were kept intact&#39;</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="nx">runtimeObj</span><span class="p">)</span> <span class="p">{</span>
@@ -259,7 +259,7 @@
<div id="ft">
<hr />
Released on <a href="https://github.com/lorenwest/node-config">github</a> under the <a href="https://github.com/lorenwest/node-config/blob/master/LICENSE">Apache License 2.0</a>
-<span class="subtitle">version 0.4.2</span>
+<span class="subtitle">version 0.4.3</span>
</div>
</div>
<script type="text/javascript">
View
@@ -4,11 +4,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>config Config </title>
- <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1310429649.38" />
- <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1310429649.38" />
+ <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1312274888.63" />
+ <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1312274888.63" />
- <script type="text/javascript" src="assets/api-js?stamp=1310429649.38"></script>
- <script type="text/javascript" src="assets/ac-js?stamp=1310429649.38"></script>
+ <script type="text/javascript" src="assets/api-js?stamp=1312274888.63"></script>
+ <script type="text/javascript" src="assets/ac-js?stamp=1312274888.63"></script>
</head>
<body id="node-monitor">
@@ -738,52 +738,6 @@ <h3 id="methods">Methods</h3>
</div>
<hr />
</div>
- <div class="protected" rel="yui:method" resource="#method__watchForConfigFileChanges">
- <h4>
- <a name="method__watchForConfigFileChanges">_watchForConfigFileChanges</a></h4>
- <div class="detail" >
- <code>
- protected
-
-
- void
- <strong property="yui:name">_watchForConfigFileChanges</strong>
- (
- )
- </code>
-
- <div class="description" property="yui:description">
- Monitor the filesystem for configuration file changes.
-<p>
-Runtime configuration changes are made by modifying the runtime.json file.
-This paradigm allows multiple application servers to internally notify
-listeners whenever the configuration changes.
-</p>
-<p>
-This method attaches the file watcher onto the runtime.json file, reloading
-the file on change and merging the new values into the CONFIG object.
-</p>
- </div>
-
- <div class="description">
-
-
- <dl>
- <dt>Returns:
- <code property="yui:return">
- void
- </code></dt>
- <dd property="yui:returnInfo"></dd>
- </dl>
-
-
-
-
- </div>
-
- </div>
- <hr />
- </div>
<div class="" rel="yui:method" resource="#method_constructor">
<h4>
<a name="method_constructor">constructor</a></h4>
@@ -1110,6 +1064,55 @@ <h3 id="methods">Methods</h3>
</div>
<hr />
</div>
+ <div class="" rel="yui:method" resource="#method_watchForConfigFileChanges">
+ <h4>
+ <a name="method_watchForConfigFileChanges">watchForConfigFileChanges</a></h4>
+ <div class="detail" >
+ <code>
+
+
+
+ void
+ <strong property="yui:name">watchForConfigFileChanges</strong>
+ (
+ )
+ </code>
+
+ <div class="description" property="yui:description">
+ Monitor the runtime.json file for configuration changes.
+<p>
+Long running processes can call this method at startup to have node-config
+automatically monitor and apply changes made to the config/runtime.json file.
+</p>
+<p>
+This paradigm allows for manual changes to running application servers,
+and for multi-node application servers to keep in sync.
+</p>
+<p>
+This method attaches a file watcher onto the runtime.json file, reloading
+the file on change and merging the new values into the CONFIG object.
+</p>
+ </div>
+
+ <div class="description">
+
+
+ <dl>
+ <dt>Returns:
+ <code property="yui:return">
+ void
+ </code></dt>
+ <dd property="yui:returnInfo"></dd>
+ </dl>
+
+
+
+
+ </div>
+
+ </div>
+ <hr />
+ </div>
</div>
</div>
@@ -1165,11 +1168,11 @@ <h3 id="methods">Methods</h3>
<li class="protected"><a href="#method__parseFile" title="_parseFile">_parseFile</a></li>
<li class="protected"><a href="#method__persistConfigsOnChange" title="_persistConfigsOnChange">_persistConfigsOnChange</a></li>
<li class="protected"><a href="#method__stripComments" title="_stripComments">_stripComments</a></li>
- <li class="protected"><a href="#method__watchForConfigFileChanges" title="_watchForConfigFileChanges">_watchForConfigFileChanges</a></li>
<li class=""><a href="#method_constructor" title="constructor">constructor</a></li>
<li class=""><a href="#method_makeImmutable" title="makeImmutable">makeImmutable</a></li>
<li class=""><a href="#method_setModuleDefaults" title="setModuleDefaults">setModuleDefaults</a></li>
<li class=""><a href="#method_watch" title="watch">watch</a></li>
+ <li class=""><a href="#method_watchForConfigFileChanges" title="watchForConfigFileChanges">watchForConfigFileChanges</a></li>
</ul>
</div>
@@ -1181,11 +1184,11 @@ <h3 id="methods">Methods</h3>
<div id="ft">
<hr />
Released on <a href="https://github.com/lorenwest/node-config">github</a> under the <a href="https://github.com/lorenwest/node-config/blob/master/LICENSE">Apache License 2.0</a>
-<span class="subtitle">version 0.4.2</span>
+<span class="subtitle">version 0.4.3</span>
</div>
</div>
<script type="text/javascript">
- ALL_YUI_PROPS = [{"url": "Config.html#method__attachProtoDeep", "access": "protected", "host": "Config", "type": "method", "name": "_attachProtoDeep"}, {"url": "Config.html#method__cloneDeep", "access": "protected", "host": "Config", "type": "method", "name": "_cloneDeep"}, {"url": "Config.html#method_constructor", "access": "", "host": "Config", "type": "method", "name": "constructor"}, {"url": "Config.html#method__diffDeep", "access": "protected", "host": "Config", "type": "method", "name": "_diffDeep"}, {"url": "Config.html#method__equalsDeep", "access": "protected", "host": "Config", "type": "method", "name": "_equalsDeep"}, {"url": "Config.html#method__extendDeep", "access": "protected", "host": "Config", "type": "method", "name": "_extendDeep"}, {"url": "Config.html#method__isObject", "access": "protected", "host": "Config", "type": "method", "name": "_isObject"}, {"url": "Config.html#method__loadFileConfigs", "access": "protected", "host": "Config", "type": "method", "name": "_loadFileConfigs"}, {"url": "Config.html#method_makeImmutable", "access": "", "host": "Config", "type": "method", "name": "makeImmutable"}, {"url": "Config.html#method__parseFile", "access": "protected", "host": "Config", "type": "method", "name": "_parseFile"}, {"url": "Config.html#method__persistConfigsOnChange", "access": "protected", "host": "Config", "type": "method", "name": "_persistConfigsOnChange"}, {"url": "Config.html#method_setModuleDefaults", "access": "", "host": "Config", "type": "method", "name": "setModuleDefaults"}, {"url": "Config.html#method__stripComments", "access": "protected", "host": "Config", "type": "method", "name": "_stripComments"}, {"url": "Config.html#method_watch", "access": "", "host": "Config", "type": "method", "name": "watch"}, {"url": "Config.html#method__watchForConfigFileChanges", "access": "protected", "host": "Config", "type": "method", "name": "_watchForConfigFileChanges"}];
+ ALL_YUI_PROPS = [{"url": "Config.html#method__attachProtoDeep", "access": "protected", "host": "Config", "type": "method", "name": "_attachProtoDeep"}, {"url": "Config.html#method__cloneDeep", "access": "protected", "host": "Config", "type": "method", "name": "_cloneDeep"}, {"url": "Config.html#method_constructor", "access": "", "host": "Config", "type": "method", "name": "constructor"}, {"url": "Config.html#method__diffDeep", "access": "protected", "host": "Config", "type": "method", "name": "_diffDeep"}, {"url": "Config.html#method__equalsDeep", "access": "protected", "host": "Config", "type": "method", "name": "_equalsDeep"}, {"url": "Config.html#method__extendDeep", "access": "protected", "host": "Config", "type": "method", "name": "_extendDeep"}, {"url": "Config.html#method__isObject", "access": "protected", "host": "Config", "type": "method", "name": "_isObject"}, {"url": "Config.html#method__loadFileConfigs", "access": "protected", "host": "Config", "type": "method", "name": "_loadFileConfigs"}, {"url": "Config.html#method_makeImmutable", "access": "", "host": "Config", "type": "method", "name": "makeImmutable"}, {"url": "Config.html#method__parseFile", "access": "protected", "host": "Config", "type": "method", "name": "_parseFile"}, {"url": "Config.html#method__persistConfigsOnChange", "access": "protected", "host": "Config", "type": "method", "name": "_persistConfigsOnChange"}, {"url": "Config.html#method_setModuleDefaults", "access": "", "host": "Config", "type": "method", "name": "setModuleDefaults"}, {"url": "Config.html#method__stripComments", "access": "protected", "host": "Config", "type": "method", "name": "_stripComments"}, {"url": "Config.html#method_watch", "access": "", "host": "Config", "type": "method", "name": "watch"}, {"url": "Config.html#method_watchForConfigFileChanges", "access": "", "host": "Config", "type": "method", "name": "watchForConfigFileChanges"}];
</script>
</body>
</html>
View
@@ -4,11 +4,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>test ConfigTest </title>
- <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1310429649.26" />
- <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1310429649.26" />
+ <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1312274888.61" />
+ <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1312274888.61" />
- <script type="text/javascript" src="assets/api-js?stamp=1310429649.26"></script>
- <script type="text/javascript" src="assets/ac-js?stamp=1310429649.26"></script>
+ <script type="text/javascript" src="assets/api-js?stamp=1312274888.61"></script>
+ <script type="text/javascript" src="assets/ac-js?stamp=1312274888.61"></script>
</head>
<body id="node-monitor">
@@ -119,7 +119,7 @@
<div id="ft">
<hr />
Released on <a href="https://github.com/lorenwest/node-config">github</a> under the <a href="https://github.com/lorenwest/node-config/blob/master/LICENSE">Apache License 2.0</a>
-<span class="subtitle">version 0.4.2</span>
+<span class="subtitle">version 0.4.3</span>
</div>
</div>
<script type="text/javascript">
@@ -4,11 +4,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>test ProtectedTest </title>
- <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1310429649.26" />
- <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1310429649.26" />
+ <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1312274888.61" />
+ <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1312274888.61" />
- <script type="text/javascript" src="assets/api-js?stamp=1310429649.26"></script>
- <script type="text/javascript" src="assets/ac-js?stamp=1310429649.26"></script>
+ <script type="text/javascript" src="assets/api-js?stamp=1312274888.61"></script>
+ <script type="text/javascript" src="assets/ac-js?stamp=1312274888.61"></script>
</head>
<body id="node-monitor">
@@ -119,7 +119,7 @@
<div id="ft">
<hr />
Released on <a href="https://github.com/lorenwest/node-config">github</a> under the <a href="https://github.com/lorenwest/node-config/blob/master/LICENSE">Apache License 2.0</a>
-<span class="subtitle">version 0.4.2</span>
+<span class="subtitle">version 0.4.3</span>
</div>
</div>
<script type="text/javascript">
Oops, something went wrong.

0 comments on commit 263062f

Please sign in to comment.