You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Jarek Gawor <jg...@gmail.com> on 2010/04/09 05:42:52 UTC

converting optional imports to dynamic imports

Hi all,

I'm beginning to think that we should convert any optional imports in
our spec jars to dynamic imports. The issue is that the optional
imports are resolved when the bundle is resolved. So if the exporting
bundle is not there at the time the importing bundle is resolved the
optional imports are not wired. And the imports stay unwired even if
the exporting bundle is installed later on. With dynamic imports the
exporting bundle could be installed before or after the importing
bundle is resolved.

Take the management spec as an example. The management spec has an
optional dependency on ejb spec. So for everything to resolve ok, I
need to install ejb spec, jaxrpc spec, and serlvet spec (ejb needs
jaxprc and jaxrpc needs servlet). With the dynamic imports we could
install the management spec without the ejb spec. And once/if the ejb
spec would be installed, the mejb part of the management spec would
work just fine (without bundle refreshes or restarts).

Jarek

Re: converting optional imports to dynamic imports

Posted by Ivan <xh...@gmail.com>.
Agree, use dynamic-import might be useful for others who would use geronimo
spec api in their OSGI environment.
For Geronimo itself, it should not be required, as I remember that Plugin
Installer would install all the required components, and dependencyManager
would handle the bundles starting.

2010/4/9 Jarek Gawor <jg...@gmail.com>

> Hi all,
>
> I'm beginning to think that we should convert any optional imports in
> our spec jars to dynamic imports. The issue is that the optional
> imports are resolved when the bundle is resolved. So if the exporting
> bundle is not there at the time the importing bundle is resolved the
> optional imports are not wired. And the imports stay unwired even if
> the exporting bundle is installed later on. With dynamic imports the
> exporting bundle could be installed before or after the importing
> bundle is resolved.
>
> Take the management spec as an example. The management spec has an
> optional dependency on ejb spec. So for everything to resolve ok, I
> need to install ejb spec, jaxrpc spec, and serlvet spec (ejb needs
> jaxprc and jaxrpc needs servlet). With the dynamic imports we could
> install the management spec without the ejb spec. And once/if the ejb
> spec would be installed, the mejb part of the management spec would
> work just fine (without bundle refreshes or restarts).
>
> Jarek
>



-- 
Ivan

Re: converting optional imports to dynamic imports

Posted by Guillaume Nodet <gn...@gmail.com>.
I think we should use both.  This way, the package would be wired on the
initial resolution if available.
And we need to make sure the exact same constraints are used for optional
and dynamic imports (including version range, etc...).

On Fri, Apr 9, 2010 at 05:42, Jarek Gawor <jg...@gmail.com> wrote:

> Hi all,
>
> I'm beginning to think that we should convert any optional imports in
> our spec jars to dynamic imports. The issue is that the optional
> imports are resolved when the bundle is resolved. So if the exporting
> bundle is not there at the time the importing bundle is resolved the
> optional imports are not wired. And the imports stay unwired even if
> the exporting bundle is installed later on. With dynamic imports the
> exporting bundle could be installed before or after the importing
> bundle is resolved.
>
> Take the management spec as an example. The management spec has an
> optional dependency on ejb spec. So for everything to resolve ok, I
> need to install ejb spec, jaxrpc spec, and serlvet spec (ejb needs
> jaxprc and jaxrpc needs servlet). With the dynamic imports we could
> install the management spec without the ejb spec. And once/if the ejb
> spec would be installed, the mejb part of the management spec would
> work just fine (without bundle refreshes or restarts).
>
> Jarek
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com