Marius Petria created SLING-4233:
------------------------------------

             Summary: Change distribution component creation from osgi config 
factories to osgi component factories
                 Key: SLING-4233
                 URL: https://issues.apache.org/jira/browse/SLING-4233
             Project: Sling
          Issue Type: Improvement
          Components: Distribution
            Reporter: Marius Petria
             Fix For: Content Distribution 0.2.0


In SLING-4154 we introduced the generation of osgi configs from a settings 
resource tree. This approach has the advantage of using osgi target bindings 
but has the disadvantage that it stores the settings in two places (in a 
resource tree e.g. /etc/.../agents and in osgi configs).

To overcome this we can generate osgi components directly instead of osgi 
configs using the ComponentFactory API [1]. That leads to the following setup.

1. Component providers register a component with 
componentFactory=sling.disitribution.importer.remote
2. All registered factories starting with sling.distribution are picked up by 
the internal DistributionComponentManager [2]
3. The ResourceBasedComponentFactory [3] listens to content changes in the 
resource tree and tries to create the corresponding component using the 
registered factories through [2].

Note that wiring is still done by osgi as the component factories use target 
reference to bind the needed subcomponents, however the settings are stored in 
the resource tree. 

[1] 
http://www.osgi.org/javadoc/r4v42/org/osgi/service/component/ComponentFactory.html
[2] 
https://github.com/apache/sling/blob/05575da39d80fc29ebd5cd4c2087933c6a97323d/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentManager.java
[3] 
https://github.com/apache/sling/blob/05575da39d80fc29ebd5cd4c2087933c6a97323d/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/ResourceBasedDistributionComponentFactory.java



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to