You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Florian Pirchner <fl...@gmail.com> on 2016/06/19 16:05:35 UTC

Dyanmic-import in http.jetty

Hi,

you defined a "dynamic import" in resource:
https://github.com/apache/felix/blob/trunk/http/jetty/pom.xml

<DynamicImport-Package>
org.osgi.service.metatype;version="[1.1,2)"
</DynamicImport-Package>

What's the mean that you did not use "import-package;optional"?

Thanks for clearing up.

Best florian

Re: Dyanmic-import in http.jetty

Posted by David Jencks <da...@yahoo.com.INVALID>.
Dynamic import means that whenever the metatype service is available, it will be used.
Optional import would mean that the metatype service would be used only if it was available when the jetty bundle was resolved, and if it became available later it would not be used.

david jencks

> On Jun 19, 2016, at 9:05 AM, Florian Pirchner <fl...@gmail.com> wrote:
> 
> Hi,
> 
> you defined a "dynamic import" in resource:
> https://github.com/apache/felix/blob/trunk/http/jetty/pom.xml
> 
> <DynamicImport-Package>
> org.osgi.service.metatype;version="[1.1,2)"
> </DynamicImport-Package>
> 
> What's the mean that you did not use "import-package;optional"?
> 
> Thanks for clearing up.
> 
> Best florian


Re: Dyanmic-import in http.jetty

Posted by Florian Pirchner <fl...@gmail.com>.
Thanks a lot.

Understand ;)

Best florian

Neil Bartlett <nj...@gmail.com> schrieb am So., 19. Juni 2016 19:10:

> Also bear in mind that the package import can dynamically UNbind as well,
> at any time. A bundle using dynamic imports has to code very defensively
> using reflection and catching the CNFEs as they arise.
>
> Neil
> On 19 Jun 2016 5:12 p.m., "Raymond Auge" <ra...@liferay.com> wrote:
>
> > DynamicImport-Package is more "dynamic" than an optional import.
> >
> > If an optional import is not found at the time the bundle is resolved,
> then
> > it will never again bind to the package if that package arrives at some
> > later time.
> >
> > One would have to force re-resolve of the bundle in order to bind to it,
> > which as you can imagine is a pain.
> >
> > However, using DynamicImport-Package will behave the same up until the
> > package becomes available. It will bind on demand.
> >
> > - Ray
> >
> > On Sun, Jun 19, 2016 at 12:05 PM, Florian Pirchner <
> > florian.pirchner@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > you defined a "dynamic import" in resource:
> > > https://github.com/apache/felix/blob/trunk/http/jetty/pom.xml
> > >
> > > <DynamicImport-Package>
> > > org.osgi.service.metatype;version="[1.1,2)"
> > > </DynamicImport-Package>
> > >
> > > What's the mean that you did not use "import-package;optional"?
> > >
> > > Thanks for clearing up.
> > >
> > > Best florian
> > >
> >
> >
> >
> > --
> > *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
> >  (@rotty3000)
> > Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
> >  (@Liferay)
> > Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> > (@OSGiAlliance)
> >
>

Re: Dyanmic-import in http.jetty

Posted by Neil Bartlett <nj...@gmail.com>.
Also bear in mind that the package import can dynamically UNbind as well,
at any time. A bundle using dynamic imports has to code very defensively
using reflection and catching the CNFEs as they arise.

Neil
On 19 Jun 2016 5:12 p.m., "Raymond Auge" <ra...@liferay.com> wrote:

> DynamicImport-Package is more "dynamic" than an optional import.
>
> If an optional import is not found at the time the bundle is resolved, then
> it will never again bind to the package if that package arrives at some
> later time.
>
> One would have to force re-resolve of the bundle in order to bind to it,
> which as you can imagine is a pain.
>
> However, using DynamicImport-Package will behave the same up until the
> package becomes available. It will bind on demand.
>
> - Ray
>
> On Sun, Jun 19, 2016 at 12:05 PM, Florian Pirchner <
> florian.pirchner@gmail.com> wrote:
>
> > Hi,
> >
> > you defined a "dynamic import" in resource:
> > https://github.com/apache/felix/blob/trunk/http/jetty/pom.xml
> >
> > <DynamicImport-Package>
> > org.osgi.service.metatype;version="[1.1,2)"
> > </DynamicImport-Package>
> >
> > What's the mean that you did not use "import-package;optional"?
> >
> > Thanks for clearing up.
> >
> > Best florian
> >
>
>
>
> --
> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
>  (@rotty3000)
> Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
>  (@Liferay)
> Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> (@OSGiAlliance)
>

Re: Dyanmic-import in http.jetty

Posted by Raymond Auge <ra...@liferay.com>.
DynamicImport-Package is more "dynamic" than an optional import.

If an optional import is not found at the time the bundle is resolved, then
it will never again bind to the package if that package arrives at some
later time.

One would have to force re-resolve of the bundle in order to bind to it,
which as you can imagine is a pain.

However, using DynamicImport-Package will behave the same up until the
package becomes available. It will bind on demand.

- Ray

On Sun, Jun 19, 2016 at 12:05 PM, Florian Pirchner <
florian.pirchner@gmail.com> wrote:

> Hi,
>
> you defined a "dynamic import" in resource:
> https://github.com/apache/felix/blob/trunk/http/jetty/pom.xml
>
> <DynamicImport-Package>
> org.osgi.service.metatype;version="[1.1,2)"
> </DynamicImport-Package>
>
> What's the mean that you did not use "import-package;optional"?
>
> Thanks for clearing up.
>
> Best florian
>



-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)