Author: buildbot
Date: Thu Mar 28 19:56:23 2013
New Revision: 856361
Log:
Staging update by buildbot for sling
Modified:
websites/staging/sling/trunk/content/ (props changed)
websites/staging/sling/trunk/content/old-stuff/run-modes-org-apache-sling-runmode.html
Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Mar 28 19:56:23 2013
@@ -1 +1 @@
-1456929
+1462279
Modified:
websites/staging/sling/trunk/content/old-stuff/run-modes-org-apache-sling-runmode.html
==============================================================================
---
websites/staging/sling/trunk/content/old-stuff/run-modes-org-apache-sling-runmode.html
(original)
+++
websites/staging/sling/trunk/content/old-stuff/run-modes-org-apache-sling-runmode.html
Thu Mar 28 19:56:23 2013
@@ -86,9 +86,13 @@
<h1>Run Modes (org.apache.sling.runmode)</h1>
- <p>{note}
-As of Sling 6 the <code>org.apache.sling.runmode</code> bundle is replaced by
the new <a
href="/documentation/bundles/sling-settings-org-apache-sling-settings.html">Sling
Settings (org.apache.sling.settings)</a> Bundle. For backwards compatibility
this bundle may still exist in your environment. New code should use the API of
the new [Sling Settings (org.apache.sling.settings)] Bundle, though.
-{note}</p>
+ <div markdown="1" class="note">
+As of Sling 6 the <code>org.apache.sling.runmode</code> bundle is replaced
+by the new <a
href="/documentation/bundles/sling-settings-org-apache-sling-settings.html">Sling
Settings (org.apache.sling.settings)</a>
+Bundle. For backwards compatibility this bundle may still exist in your
environment. New code should use the API of the new
+Sling Settings Bundle, though.
+</div>
+
<h1 id="overview">Overview</h1>
<p>Run modes are meant to define different sets of configuration parameters
for various Sling instances.</p>
<p>In a web publishing environment, for example, one could use run modes like
<em>staging, production, dev, dmz</em> or combinations of such values.</p>
@@ -101,23 +105,23 @@ As of Sling 6 the <code>org.apache.sling
<p>This command-line parameter takes precedence over a similar definition
(<em>sling.run.modes=dev,staging</em>) that might be present in the
<em>sling.properties</em> file found in the Sling home directory.</p>
<h1 id="getting-the-current-list-of-run-modes">Getting the current list of run
modes</h1>
<p>The <a href="">RunMode service</a> provides the current list of run modes,
examples:</p>
-<p><DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV
class="codeHeader panelHeader" style="border-bottom-width:
1px;border-bottom-style: solid;"><B>RunMode examples</B></DIV><DIV
class="codeContent panelContent">
- RunMode r = ...get from BundleContext...
- String [] currentRunModes = r.getCurrentRunModes();</p>
-<div class="codehilite"><pre><span class="n">String</span> <span
class="o">[]</span> <span class="n">expectedRunModes</span> <span
class="o">=</span> <span class="p">{</span> <span
class="s">"foo"</span><span class="p">,</span> <span
class="s">"wii"</span> <span class="p">};</span>
-<span class="k">if</span><span class="p">(</span><span class="n">r</span><span
class="o">.</span><span class="n">isActive</span><span class="p">(</span><span
class="n">expectedRunModes</span><span class="p">))</span> <span
class="p">{</span>
- <span class="sr">//</span> <span class="n">at</span> <span
class="n">least</span> <span class="n">one</span> <span class="n">of</span>
<span class="p">(</span><span class="n">foo</span><span class="p">,</span><span
class="n">wii</span><span class="p">)</span> <span class="n">run</span> <span
class="n">modes</span>
- <span class="sr">//</span> <span class="n">is</span> <span
class="n">active</span>
-<span class="p">}</span>
+<div class="codehilite"><pre><span class="n">RunMode</span> <span
class="n">r</span> <span class="o">=</span> <span class="o">...</span><span
class="na">get</span> <span class="n">from</span> <span
class="n">BundleContext</span><span class="o">...</span>
+<span class="n">String</span> <span class="o">[]</span> <span
class="n">currentRunModes</span> <span class="o">=</span> <span
class="n">r</span><span class="o">.</span><span
class="na">getCurrentRunModes</span><span class="o">();</span>
+
+<span class="n">String</span> <span class="o">[]</span> <span
class="n">expectedRunModes</span> <span class="o">=</span> <span
class="o">{</span> <span class="s">"foo"</span><span
class="o">,</span> <span class="s">"wii"</span> <span
class="o">};</span>
+<span class="k">if</span><span class="o">(</span><span class="n">r</span><span
class="o">.</span><span class="na">isActive</span><span class="o">(</span><span
class="n">expectedRunModes</span><span class="o">))</span> <span
class="o">{</span>
+ <span class="c1">// at least one of (foo,wii) run modes</span>
+ <span class="c1">// is active</span>
+<span class="o">}</span>
</pre></div>
<h1 id="see-also">See also</h1>
<p>The RunMode service is used by the <a
href="/documentation/bundles/jcr-installer-provider.html">jcrinstall</a>
services.</p>
<h1 id="automated-tests">Automated tests</h1>
-<p>The <a href="">RunModeImplTest class</a> provides more info about run modes
parsing and usage.</p>
+<p>The <a
href="http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/runmode/src/test/java/org/apache/sling/runmode/impl/RunModeImplTest.java">RunModeImplTest
class</a> provides more info about run modes parsing and usage.</p>
<div class="timestamp" style="margin-top: 30px; font-size: 80%;
text-align: right;">
- Rev. 1341376 by fmeschbe on Tue, 22 May 2012 09:41:06 +0000
+ Rev. 1462279 by fmeschbe on Thu, 28 Mar 2013 19:56:14 +0000
</div>
<div class="trademarkFooter">
Apache Sling, Sling, Apache, the Apache feather logo, and the Apache
Sling project