Hi,

No, initial enablement of components is coded in the component.xml and
any changes through the ScrService API are purely transitional.

What you can do, though, is leverage the R4.2 configuration policy: Set
the policy to required and provide or don't provide configuration. As
long as there is no configuration, the component is not activated (much
like a required service reference). Once configuration becomes
available, the component is activated..

Regards
Felix

On 30.09.2011 06:04, Ian Boston wrote:
> Hi,
> Is if possible to enable and disable components, and have that
> enable/disable persist over Sling/Felix restarts ?
>
> I have 2 components. A is enabled, B is disabled in the serviceComponents.xml.
> I want to ensure that A is disabled and B is enabled on the first
> start of the container, and I would rather not unpack the bundle, edit
> serviceComponents.xml and repack the bundle.
>
> I am currently looking at fragment bundles but according to
> scr/src/main/java/org/apache/felix/scr/impl/BundleComponentActivator.java
> you cant re-configure part of a component, you can only provide a
> complete replacement serviceComponent.xml file. (is that right ?)
>
> Ian
>

Reply via email to