[
https://issues.apache.org/jira/browse/SLING-4154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14216176#comment-14216176
]
Carsten Ziegeler commented on SLING-4154:
-----------------------------------------
I haven't fully thought this through, therefore it might be complete nonsense,
but let's assume we go the full OSGi way based on services.
Let's also assume we have two services Agent and PackageExporter to simplify
the picture. We can mount a custom resource provider at /config (of course in
real life this would be a different path) and for example the following
resource tree is created there
agent1
- type = default
- title = An agent
- foo = 3
- bar = 5
+ PackageExporter
- type = vlt
- a=b
This is a virtual resource tree processed by the custom resource provider and
this creates OSGi configurations from such a resource tree, one for (I'll leave
out the package) Agent.default and one for PackageExporter.vlt. There is a
component factory registered for Agent.default providing Agent services and one
for PackageExporter.vlt registering PackageExporter services.
However, these services need now to be connect, so the resource provider adds a
property path with the value /config/agent1 to each OSGi configuration. This
can be used to control the target property for the references from the agents
to the package exporter.
In addition, the path property can be used to create the resource tree if the
resource provider is asked for the resource at /config/agent1
So everything is nicely administrated on a resource level which gives the
"single json" approach for reading and writing. As these are resources, they
can easily distributed to another instance, on the other hand everything is
managed by OSGi configurations and services.
> Discuss distribution components creation and configuration
> -----------------------------------------------------------
>
> Key: SLING-4154
> URL: https://issues.apache.org/jira/browse/SLING-4154
> Project: Sling
> Issue Type: Task
> Components: Distribution
> Reporter: Marius Petria
> Fix For: Content Distribution 0.2.0
>
>
> Distribution has one main component (agent) and several secondary components
> (triggers, exporters and importers).
> These can be created as java objects using a DistributionComponentFactory.
> The core framework provides a DefaultDistributionComponentFactory that will
> create the components implemented in the core but a client can define its own
> components and factory and the default component factory will use those to
> create a component it does not know of.
> The core framework also provides two ways of registering such a java object
> as an OSGI service:
> 1. using osgi configs, the osgi properties are parsed and passed to the
> factory, a component is created and registered
> (GenericDistributionComponentFactory)
> 2. resource configs, the properties of a resource are parsed and passed to
> the factory, a component is created and registered
> (ResourceBasedDistributionComponentFactory)
> Components registered as OSGI services are available as resources via
> OsgiServicePropertiesResourceProvider.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)