I came up with the following extension:

https://github.com/apache/karaf/blob/master/features/extension/src/main/java/org/apache/karaf/features/extension/Activator.java

It seems to work correctly so far.  I suppose it would be even faster to
have it in the framework to avoid going through the resolver at all, but it
seems to fulfill my needs.



2016-10-03 18:02 GMT+02:00 Guillaume Nodet <gno...@apache.org>:

> I have a use case where the wiring is a bit complicated.
> Karaf uses the felix resolver to compute the full wiring and then applies
> it.
> At this point, all the bundles are resolved and started correctly.
> If Karaf is restarted, the framework restarts and resolves the bundles on
> its own, using a bad solution (because the resolver is not greedy) which
> leaves some bundles in a non resolvable state (i.e. without refreshing some
> bundles).
> At this point, I've tried to have Karaf stores the computed wiring so that
> it can be re-applied when restarting.  Unfortunately, in my very case, the
> wiring is done in such a way that nearly all bundles needs to be refreshed,
> even the one containing the bundle hook, so that's bound to deadlocks and
> various problems.
>
> I'm left with two solutions :
>   * implement a framework extension to minimize the chances to have to
> refresh the bundle containing the resolver hook
>   * implement a persistent resolution in felix
>
> I don't mind either way, but I wonder if instead of implementing it in
> Karaf, it could be done in the framework in a slightly more robust way
> (i.e. not contained in a bundle which itself is bound to refreshes, etc...)
> and may be reused by others.
>
> Thoughts ?
>
> Guillaume
>
> --
> ------------------------
> Guillaume Nodet
> ------------------------
> Red Hat, Open Source Integration
>
> Email: gno...@redhat.com
> Web: http://fusesource.com
> Blog: http://gnodet.blogspot.com/
>
>


-- 
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Email: gno...@redhat.com
Web: http://fusesource.com
Blog: http://gnodet.blogspot.com/

Reply via email to