Hi,

Am 13.04.2012 um 17:03 schrieb Robert Munteanu:

>>>> Additionally, it seems you might be confused about the
>> responsibility
>>>> of
>>>> some tasks. For example, SCR doesn't look for changes in component
>>>> descriptors at all, it simply listens for bundles to be activated.
>>>> Listening to changes in the component descriptor would have to hook
>>>> into
>>>> the build process somehow. By and large, none of the Felix
>> subprojects
>>>> are involved in the build process other than the Maven Bundle
>> plugin.
>>> I have considered hooking into the maven-bundle-plugin as well, but I
>> have no idea on how to notify Felix that a bundle needs to be refreshed
>> or even send a custom event which I can handle myself.
>> 
>> If you use something like File Install and generate bundle's into a
>> directory managed by File Install, it will automatically update and
>> refresh the bundle when its JAR file changes, which would cause SCR to
>> stop, then restart managing it. It's a little more coarse grained that
>> what you want, but it should work out of the box with a lot less
>> effort.
> 
> One of my (self-imposed) constraints is that this process should be 
> IDE-driven rather than build tool-driven. The main reason is performance - I 
> prefer not to repackage bundles on each change since that will take some 
> time. 
> 
> Instead, I prefer to react to filesystem changes myself and nicely ask the 
> Felix container to refresh a bundle if needed. As as far as I can see 
> fileinstall handles only configuration and jar files, not SCR descriptors and 
> I think that this is not something which belongs in the core fileinstall 
> bundle. 
> 
> Perhaps I can explain better with an example rather than in abstract terms, 
> so here's what I want to achieve in terms of development experience:
> 
> 1. Start Apache Felix with SCR capabilities and with the JRebel agent
> 2. Deploy a bundle with a JRebel configuration attached
> 3. Start listening for changes to the declared SCR descriptors of the bundle

That's part of JRebel support ?

> 4. When the SCR descriptors change on disk, call 
> PackageAdmin.refreshPackages()

This is probably not adequate (or even required): What you would have to do is 
just stop and start the bundles. refreshPackages would only be required if you 
want the wires of the bundle refresh.

> 
> I can safely do (4) the packages since JRebel already ensures that I will get 
> the most current version of the class without needing to redeploy the bundle. 
> I purposefully ignore how the changes will be made for (3) since that's a 
> different implementation topic.
> 
> I am aware that this process does not make sense unless JRebel is used, so 
> that's why I'm trying to find out the best way of hooking into the framework 
> without the need to make invasive changes.

The longer I think of it, the longer I think such a thing is really futile ...

Bundle deployment is generally really fast -- unless your bundle is large and 
has a complex import/export list, which would make that bundle a bad bundle by 
definition ;-)

I honestly fail to see the point of JRebel in an OSGi framework ...

Regards
Felix

> 
> Robert
> 
>> 
>> -> richard
>> 
>>> 
>>> Thanks,
>>> 
>>> Robert
>>> 
>>>> ->  richard
>>>> 
>>>>> I would like to validate that this is at all possible within Apache
>>>> Felix and to ask which are the best places to start looking for
>> adding
>>>> the JRebel functionality. Any thoughts/pointers on how to best start
>>>> developing this would be greatly appreciated.
>>>> 
>>>>> If this is feasible, I intend to develop this as a separate JRebel
>>>> plugin and contribute it to the Apache Felix project.
>>>>> Thanks,
>>>>> 
>>>>> Robert
>>>>> 
>>>>> [1]: http://zeroturnaround.com/jrebel/
>>>>> [2]: http://zeroturnaround.com/jrebel/features/
>>>>> 

Reply via email to