RunMode service
---------------

                 Key: SLING-654
                 URL: https://issues.apache.org/jira/browse/SLING-654
             Project: Sling
          Issue Type: Improvement
          Components: Extensions
            Reporter: Bertrand Delacretaz
            Priority: Minor


It is often useful to enable/disable groups of components and services 
according to "run modes" like "development", "authoring", etc.

This was already discussed in http://markmail.org/message/76j6asutb2jtl27g , 
here's a more concrete spec based on an actual use case. This will be 
implemented in a new sling/extensions/runmode module.

-The RunMode service defines (from the environment, system properties, 
whatever) a set of "run modes" that are currently active, for example

 { "author", "dmz", "development" }

-OSGi components that are "run-mode aware" should use a multi-value 
configuration parameter to define in which run modes they are active.

-The RunMode service is used to selectively disable components, something like

   /** @scr.reference */
   RunMode runMode;

   private String [] myActiveRunModes;

   protected void activate(ComponentContext ctx) {
     if(!runMode.isActive(myActiveRunModes)) {
       ctx.disableComponent(myComponentName);
     }
   }






-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to