Run Modes (org.apache.sling.runmode)Page edited by Felix MeschbergerChanges (1)
Full Content
OverviewRun modes are meant to define different sets of configuration parameters for various Sling instances. In a web publishing environment, for example, one could use run modes like staging, production, dev, dmz or combinations of such values. The org.apache.sling.runmode bundle provides a simple way of defining and querying a list of run modes. InstallationThe run mode service is not present in the default Sling launchpad builds, to activate it install and start the org.apache.sling.runmode bundle. ConfigurationRun modes can only be configured using a system property, or via the sling.properties file. Using -Dsling.run.modes=foo,bar on the JVM command-line, for example, activates the foo and bar run modes. This command-line parameter takes precedence over a similar definition (sling.run.modes=dev,staging) that might be present in the sling.properties file found in the Sling home directory. Getting the current list of run modesThe RunMode service provides the current list of run modes, examples: RunMode examples
RunMode r = ...get from BundleContext...
String [] currentRunModes = r.getCurrentRunModes(); String [] expectedRunModes = { "foo", "wii" }; if(r.isActive(expectedRunModes)) { // at least one of (foo,wii) run modes // is active } See alsoThe RunMode service is used by the jcrinstall services. Automated testsThe RunModeImplTest class provides more info about run modes parsing and usage.
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
- [CONF] Apache Sling Website > Run Modes (org.apache.sling.ru... confluence
- [CONF] Apache Sling Website > Run Modes (org.apache.sli... confluence