[ 
https://issues.apache.org/jira/browse/SLING-4154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14217661#comment-14217661
 ] 

Marius Petria commented on SLING-4154:
--------------------------------------

[~cziegeler] that is indeed a different option. There are two issues that need 
to be discussed in regards to it.

1. The AgentConfig (ImporterConfig, ExporterConfig) objects will be very loose 
semantically (close to a map of properties) as they are an API abstraction of 
potentially different implementations. As it is so loose we can even choose to 
have a single DistributionConfig object with a map inside to pass it around.
2. These configs must be passed through all APIs 
PackageExporter.exportPackage(..., ExporterConfig) getPackage(..., 
ExporterConfig). 
3. One also has to switch implementations through configuration so basically 
the workflow becomes like this:

execute(request, config)
exporterConfig = extract("exporter", config);
packageExporter = componentProvider.getComponent(exporterConfig.getType());
packageExporter.exportPackage(request, exporterConfig)

Anyway that means as you said we do not wire distribution components through 
OSGI configs and do not configure them through osgi configs (we can configure 
only the system wide things).



> 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)

Reply via email to