You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Róbert Csákány (JIRA)" <ji...@apache.org> on 2010/02/18 20:30:27 UTC

[jira] Created: (FELIX-2100) Initial Config Loader

Initial Config Loader
---------------------

                 Key: FELIX-2100
                 URL: https://issues.apache.org/jira/browse/FELIX-2100
             Project: Felix
          Issue Type: New Feature
          Components: Bundle Repository (OBR), Configuration Admin
            Reporter: Róbert Csákány


I've a request to be able to make customer specific configuration bundles - bundles that includes Configurations for other bundles. If a bundle is deployed, extracts the configuration files and register it with configadmin. If bundle is removed, removes configurations. If you have ideas, please share it! (I'm new in this Felix world, I've used it only with Sling as a user)

I will make a short proporsal and a whiteboard implementation.

The name of impmelemtation is configloader
The configloader service will implement the SynchronousBundleListener, and registering itself in activation and unregistering in deactivation.

When a new bundle is registering, checking the Bundle-InitialConfigurations in META-INF/MANIFEST.MF file. If the entry is presented, checking the given folders for *.xml files describes the configurations entry. (To handle the Factory services also).

Is it correct?



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


[jira] Commented: (FELIX-2100) Initial Config Loader

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12835594#action_12835594 ] 

Richard S. Hall commented on FELIX-2100:
----------------------------------------

I think the OBR spec definitely intends to support other resource types, but so far has only demonstrated this fact by calling the base unit of description a "resource". I have thought a little bit about this area too and I think it makes sense to improve upon the situation. This will be an area I investigate when I find the time to work on OBR in more depth. My current thought is that we should basically adopt the ResourceProcessor approach of the Deployment Admin spec, but I haven't given it too much more thought than just reaching this conclusion. :-)

> Initial Config Loader
> ---------------------
>
>                 Key: FELIX-2100
>                 URL: https://issues.apache.org/jira/browse/FELIX-2100
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR), Configuration Admin
>            Reporter: Róbert Csákány
>
> I've a request to be able to make customer specific configuration bundles - bundles that includes Configurations for other bundles. If a bundle is deployed, extracts the configuration files and register it with configadmin. If bundle is removed, removes configurations. If you have ideas, please share it! (I'm new in this Felix world, I've used it only with Sling as a user)
> I will make a short proporsal and a whiteboard implementation.
> The name of impmelemtation is configloader
> The configloader service will implement the SynchronousBundleListener, and registering itself in activation and unregistering in deactivation.
> When a new bundle is registering, checking the Bundle-InitialConfigurations in META-INF/MANIFEST.MF file. If the entry is presented, checking the given folders for *.xml files describes the configurations entry. (To handle the Factory services also).
> Is it correct?

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


[jira] Updated: (FELIX-2100) Initial Config Loader

Posted by "Róbert Csákány (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Róbert Csákány updated FELIX-2100:
----------------------------------

    Attachment: configloader.zip

I've made the bundle. Please review and test it. In my Sling environment it works
correctly.
------------------------------------------------------
The attached bundle provides initial configuration loading through bundles.

This bundle initialize configuration or factory configurations from the bundles are 
ACTIVE or became active. 
Any ACTIVE bundles that have Felix-Initial-Configuration entry in 
META-INF/MANIFEST.MF are processing. The Felix-Initial-Configuration contain 
path entries, thats are processed by this bundle. This bundle scan the path entries
for *.cfg - which is configurations for bundles (For more information check the 
fileinstall, the file format is same). In the processing of bundles the original 
configuration (if have) are saved in the "user.dir". When the bundle's status
changes from ACTIVE, the original config is restored (or if haven't got, deleted)

Example:

The bundle contains the following files:

- META-INF/MANIFEST.MF

Manifest-Version: 1.0
Felix-Initial-Configuration: SLING-INF/configuration
Built-By: robson
Build-Jdk: 1.6.0_17
Bundle-Version: 1.0.0
Tool: Bnd-0.0.357
Bundle-Name: liveSense Configuration Load Sample
Bnd-LastModified: 1266594965213
Created-By: Apache Maven Bundle Plugin
Bundle-ManifestVersion: 2
Bundle-Description: liveSense Configuration Load sample
Bundle-SymbolicName: org.liveSense.org.liveSense.sample.configurationLoad


- SLING-INF/configuration/org.apache.sling.fsprovider.internal.FsResourceProvider-ROOT.cfg
provider.roots=/fsroot
provider.file=/


When this package becomes active, the configloader creates an FsResourceProvider instance with 
the parameters. When the package stop, the FsResolverProvider instance deletes.


> Initial Config Loader
> ---------------------
>
>                 Key: FELIX-2100
>                 URL: https://issues.apache.org/jira/browse/FELIX-2100
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR), Configuration Admin
>            Reporter: Róbert Csákány
>         Attachments: configloader.zip
>
>
> I've a request to be able to make customer specific configuration bundles - bundles that includes Configurations for other bundles. If a bundle is deployed, extracts the configuration files and register it with configadmin. If bundle is removed, removes configurations. If you have ideas, please share it! (I'm new in this Felix world, I've used it only with Sling as a user)
> I will make a short proporsal and a whiteboard implementation.
> The name of impmelemtation is configloader
> The configloader service will implement the SynchronousBundleListener, and registering itself in activation and unregistering in deactivation.
> When a new bundle is registering, checking the Bundle-InitialConfigurations in META-INF/MANIFEST.MF file. If the entry is presented, checking the given folders for *.xml files describes the configurations entry. (To handle the Factory services also).
> Is it correct?

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


[jira] Commented: (FELIX-2100) Initial Config Loader

Posted by "Róbert Csákány (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836145#action_12836145 ] 

Róbert Csákány commented on FELIX-2100:
---------------------------------------

Configloader don't depends on FileInstall package.  I reused some code from it (and some pattern from Sling content loader), my bundle operates only two other bundle, ConfigAdmin and LogService (optional) - So it's a separate bundle. There was no point to integrate my code to fileinstall because I used only the config parser and some util function from it - too much refactoring in fileinstall is needed to integrate.

I've checked the possibility the usage of API, but for me it was not clear how can I bind the ResourceProcessor to the bundle content. As I understand in the code the ResourceProcesor couldn't operate without DeploymentAdmin package. The ResourceProcessors connects with DeploymentAdmin bundle with several points - to follow the DeploymentAdmin lifecycle and the content loading based on DeploymentSession as OSGI interfaces describes - the DeploymentAdmin calls ResourceProcessor over Command interface). 

Maybe It can be make a new prototype for  a content calllback mechanism where BundleContentCallbackProcessor services are registered - but it's not so simple because the bundles lifecycle (cancel and rollback mechanism) - if I have some time I will analyze the possibilities. - I need time to understand OSGi and Felix API in deep.

You have to understand I'm very new in this OSGi world and I have big black holes in my knowledge. I need a fast, independent solution.

> Initial Config Loader
> ---------------------
>
>                 Key: FELIX-2100
>                 URL: https://issues.apache.org/jira/browse/FELIX-2100
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR), Configuration Admin
>            Reporter: Róbert Csákány
>         Attachments: configloader.zip
>
>
> I've a request to be able to make customer specific configuration bundles - bundles that includes Configurations for other bundles. If a bundle is deployed, extracts the configuration files and register it with configadmin. If bundle is removed, removes configurations. If you have ideas, please share it! (I'm new in this Felix world, I've used it only with Sling as a user)
> I will make a short proporsal and a whiteboard implementation.
> The name of impmelemtation is configloader
> The configloader service will implement the SynchronousBundleListener, and registering itself in activation and unregistering in deactivation.
> When a new bundle is registering, checking the Bundle-InitialConfigurations in META-INF/MANIFEST.MF file. If the entry is presented, checking the given folders for *.xml files describes the configurations entry. (To handle the Factory services also).
> Is it correct?

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


[jira] Commented: (FELIX-2100) Initial Config Loader

Posted by "Róbert Csákány (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12835749#action_12835749 ] 

Róbert Csákány commented on FELIX-2100:
---------------------------------------

I've cheked the ResourceProcessor and DeploymentAdmin. My problem is with this solution the DependencyManager bundle also needed, so for that functionality I have to deploy 4 bundle. 
I analyzed the structure of DeploymentAdmin and ResourceProcessing. Not too easy to understand the flow. It's not clear for me how can I define ResourceProcessor in manifest. (I've found a tag Resource-Processor - but it's not clear how can I pass the pathes that need to process)

Regards, 

Robert





> Initial Config Loader
> ---------------------
>
>                 Key: FELIX-2100
>                 URL: https://issues.apache.org/jira/browse/FELIX-2100
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR), Configuration Admin
>            Reporter: Róbert Csákány
>
> I've a request to be able to make customer specific configuration bundles - bundles that includes Configurations for other bundles. If a bundle is deployed, extracts the configuration files and register it with configadmin. If bundle is removed, removes configurations. If you have ideas, please share it! (I'm new in this Felix world, I've used it only with Sling as a user)
> I will make a short proporsal and a whiteboard implementation.
> The name of impmelemtation is configloader
> The configloader service will implement the SynchronousBundleListener, and registering itself in activation and unregistering in deactivation.
> When a new bundle is registering, checking the Bundle-InitialConfigurations in META-INF/MANIFEST.MF file. If the entry is presented, checking the given folders for *.xml files describes the configurations entry. (To handle the Factory services also).
> Is it correct?

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


[jira] Commented: (FELIX-2100) Initial Config Loader

Posted by "Róbert Csákány (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839421#action_12839421 ] 

Róbert Csákány commented on FELIX-2100:
---------------------------------------

I'm thinking a lot of about this. You are right, if we wanna do config loading as a resource with a new resource processor - for example in this case ConfigResourceProcessor 

Pros:
 -  There is a general mechanism for processing config files - But there is another question how can utilize fileInstall the new mechanism? Because there are config files out of Bundle.
 -  Easy to implement new resource type - But what another type of resource can be important for Felix? What type of informations can be usable for OSGI from a bundle? As I know the Felix only use Configuration data and the Bundle JAR itself. (Maybe you can say an example for me)

Conts:
 -  Minimum +2 two bundle, for the same functionality - we don't get clearer code or less bottleneck

So to summerize, you are right that the perfect way from an architect aspect is that we have to keep away the extender pattern, but in this situation I can't tell a good reason why need it. Maybe there is another types of resources thats are interesting for Felix, but I don't know them. 
If you can tell me a good example, I will plan and implement it  - this is an interesting problem for me and a real life example is usefull to learn :)
Thanks for your opinions, it helps me to understand the possibilities of Felix.



> Initial Config Loader
> ---------------------
>
>                 Key: FELIX-2100
>                 URL: https://issues.apache.org/jira/browse/FELIX-2100
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR), Configuration Admin
>            Reporter: Róbert Csákány
>         Attachments: configloader.zip
>
>
> I've a request to be able to make customer specific configuration bundles - bundles that includes Configurations for other bundles. If a bundle is deployed, extracts the configuration files and register it with configadmin. If bundle is removed, removes configurations. If you have ideas, please share it! (I'm new in this Felix world, I've used it only with Sling as a user)
> I will make a short proporsal and a whiteboard implementation.
> The name of impmelemtation is configloader
> The configloader service will implement the SynchronousBundleListener, and registering itself in activation and unregistering in deactivation.
> When a new bundle is registering, checking the Bundle-InitialConfigurations in META-INF/MANIFEST.MF file. If the entry is presented, checking the given folders for *.xml files describes the configurations entry. (To handle the Factory services also).
> Is it correct?

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


[jira] Commented: (FELIX-2100) Initial Config Loader

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836123#action_12836123 ] 

Richard S. Hall commented on FELIX-2100:
----------------------------------------

Actually, I wasn't thinking about reusing the Deployment Admin implementation, I was just thinking about using the API. Since this is a general issue that goes beyond deploying just configurations, it would be nice to have a general solution. I was thinking about just making the deployment algorithm search the service registry for available ResourceProcessors to see if it could find one associated with the current type. If so, it would hand off to it, if not it would log an error. Something along those lines. As I said, I haven't looked into it too deeply at this point.

> Initial Config Loader
> ---------------------
>
>                 Key: FELIX-2100
>                 URL: https://issues.apache.org/jira/browse/FELIX-2100
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR), Configuration Admin
>            Reporter: Róbert Csákány
>         Attachments: configloader.zip
>
>
> I've a request to be able to make customer specific configuration bundles - bundles that includes Configurations for other bundles. If a bundle is deployed, extracts the configuration files and register it with configadmin. If bundle is removed, removes configurations. If you have ideas, please share it! (I'm new in this Felix world, I've used it only with Sling as a user)
> I will make a short proporsal and a whiteboard implementation.
> The name of impmelemtation is configloader
> The configloader service will implement the SynchronousBundleListener, and registering itself in activation and unregistering in deactivation.
> When a new bundle is registering, checking the Bundle-InitialConfigurations in META-INF/MANIFEST.MF file. If the entry is presented, checking the given folders for *.xml files describes the configurations entry. (To handle the Factory services also).
> Is it correct?

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


[jira] Commented: (FELIX-2100) Initial Config Loader

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836124#action_12836124 ] 

Richard S. Hall commented on FELIX-2100:
----------------------------------------

Regarding your config loader, are you envisioning this as a separate bundle or combined with an existing bundle? Seems like it is most closely related to File Install...

> Initial Config Loader
> ---------------------
>
>                 Key: FELIX-2100
>                 URL: https://issues.apache.org/jira/browse/FELIX-2100
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR), Configuration Admin
>            Reporter: Róbert Csákány
>         Attachments: configloader.zip
>
>
> I've a request to be able to make customer specific configuration bundles - bundles that includes Configurations for other bundles. If a bundle is deployed, extracts the configuration files and register it with configadmin. If bundle is removed, removes configurations. If you have ideas, please share it! (I'm new in this Felix world, I've used it only with Sling as a user)
> I will make a short proporsal and a whiteboard implementation.
> The name of impmelemtation is configloader
> The configloader service will implement the SynchronousBundleListener, and registering itself in activation and unregistering in deactivation.
> When a new bundle is registering, checking the Bundle-InitialConfigurations in META-INF/MANIFEST.MF file. If the entry is presented, checking the given folders for *.xml files describes the configurations entry. (To handle the Factory services also).
> Is it correct?

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


[jira] Commented: (FELIX-2100) Initial Config Loader

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836324#action_12836324 ] 

Richard S. Hall commented on FELIX-2100:
----------------------------------------

Yeah, for a quick and dirty solution you are probably on the right track, but I haven't looked at your implementation so I cannot say if it is done in the best way.

Also, I am not saying your bundle depends on File Install, I am wondering if it has enough synergy to become part of File Install. Earlier you complained about having to deploy too many bundles to get the desired functionality, so this comment is more directed at that.

Still, I am more thinking about how to handle the generic issue. OBR deploys resources, but currently it only knows how to process bundle resources. Other types of resources are installed, but have no follow on activity. If we assume that every processor, like yours, follows the extender pattern like yours, then maybe this is sufficient since they will just jump to action once a resource of their type is installed.

However, I was wondering if there is some generic layer here, like what Deployment Admin offers with Resource Processors. If that API is too tied to DA, then we don't need to use it, but its concepts are still valid, so can they be reused? Would it be worthwhile?

> Initial Config Loader
> ---------------------
>
>                 Key: FELIX-2100
>                 URL: https://issues.apache.org/jira/browse/FELIX-2100
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR), Configuration Admin
>            Reporter: Róbert Csákány
>         Attachments: configloader.zip
>
>
> I've a request to be able to make customer specific configuration bundles - bundles that includes Configurations for other bundles. If a bundle is deployed, extracts the configuration files and register it with configadmin. If bundle is removed, removes configurations. If you have ideas, please share it! (I'm new in this Felix world, I've used it only with Sling as a user)
> I will make a short proporsal and a whiteboard implementation.
> The name of impmelemtation is configloader
> The configloader service will implement the SynchronousBundleListener, and registering itself in activation and unregistering in deactivation.
> When a new bundle is registering, checking the Bundle-InitialConfigurations in META-INF/MANIFEST.MF file. If the entry is presented, checking the given folders for *.xml files describes the configurations entry. (To handle the Factory services also).
> Is it correct?

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