sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [CONF] Apache Sling Website > Run Modes (
Date Tue, 01 Dec 2009 15:16:00 GMT
    <base href="">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=SLINGxSITE&amp;forWysiwyg=true"
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="">Run
Modes (</a></h2>
    <h4>Page  <b>added</b> by             <a href="">Bertrand
    <div class="notificationGreySide">
         <h1><a name=""></a>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>

<p>The <em><a href=""
rel="nofollow"></a></em> bundle provides a simple way
of defining and querying a list of run modes.</p>

<h1><a name=""></a>Installation</h1>

<p>The run mode service is not present in the default Sling launchpad builds, to activate
it install and start the <em></em> bundle.</p>

<h1><a name=""></a>Configuration</h1>

<p>Run modes can only be configured using a system property, or via the <em></em>

<p>Using <em>,bar</em> on the JVM command-line, for
example, activates the <em>foo</em> and <em>bar</em> run modes. </p>

<p>This command-line parameter takes precedence over a similar definition (<em>,staging</em>)
that might be present in the <em></em> file found in the Sling
home directory.</p>

<h1><a name=""></a>Getting
the current list of run modes</h1>

<p>The <a href=""
rel="nofollow">RunMode service</a> provides the current list of run modes, examples:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>RunMode examples</b></div><div
class="codeContent panelContent">
<pre class="code-java">
RunMode r = ...get from BundleContext...
<span class="code-object">String</span> [] currentRunModes = r.getCurrentRunModes();

<span class="code-object">String</span> [] expectedRunModes = { <span class="code-quote">"foo"</span>,
<span class="code-quote">"bar"</span> };
<span class="code-keyword">if</span>(r.isActive(expectedRunModes)) {
  <span class="code-comment">// both foo and bar run modes are active

<h1><a name=""></a>See also</h1>

<p>The RunMode service is used by the <a href="/confluence/display/SLINGxSITE/JCR+Installer+%28jcr.jcrinstall+and+osgi.installer%29"
title="JCR Installer (jcr.jcrinstall and osgi.installer)">jcrinstall</a> services.</p>

<h1><a name=""></a>Automated

<p>The <a href=""
rel="nofollow">RunModeImplTest class</a> provides more info about run modes parsing
and usage.</p>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href=""
class="grey">Change Notification Preferences</a>
       <a href="">View
       <a href=";showCommentArea=true#addcomment">Add

View raw message