You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Marc-Andre Houle <mh...@gmail.com> on 2009/10/14 16:27:44 UTC

Having access to all exported class from framework

Hello all,

I'm using felix as my OSGi framework to make my already created application
modular.  Basically, we are using the OSGi system to plugin in module at
boot and make them available to the UI. We are using wicket as our web
framework. To load the felix system, I'm using the 4.2 generic method of
OSGi to get a FrameworkFactory and then a framework instance.

Since the Wicket is actively using the class searching mechanism instead of
using class forname directly, it is possible for my to also search into the
OSGi system. Presently, I implemented a bundle with a manifest containing a
Dynamic import statement on * in order to give access to all class to the
wicket framework.  For me, it would be greatly easier to take the system
bundle (the framework instance) and ask it to resolve in the exportable
package of the system.
Is there a way to configure the framework to work like the dynamic import
statement?  Since there is no real manifest, how can I specify this?

Thanks a lot in advance.

Marc-Andre

Re: Having access to all exported class from framework

Posted by Marc-Andre Houle <mh...@gmail.com>.
The website does not look like it refer to the common classloader.... (
http://sling.apache.org/site/bundles.html)
Did I look at the right place for that?

>From what you seems to tell me, there is not much other possibility than to
use the dynamic-import if I don't use a specific classloader that is
resolving information in the OSGi context.

Thanks for the answer. I would be interested to see how this classloader is
working and resolving the issue.

Marc-Andre

On Wed, Oct 14, 2009 at 11:30 AM, Carsten Ziegeler <cz...@apache.org>wrote:

> Marc-Andre Houle wrote:
> > Hello all,
> >
> > I'm using felix as my OSGi framework to make my already created
> application
> > modular.  Basically, we are using the OSGi system to plugin in module at
> > boot and make them available to the UI. We are using wicket as our web
> > framework. To load the felix system, I'm using the 4.2 generic method of
> > OSGi to get a FrameworkFactory and then a framework instance.
> >
> > Since the Wicket is actively using the class searching mechanism instead
> of
> > using class forname directly, it is possible for my to also search into
> the
> > OSGi system. Presently, I implemented a bundle with a manifest containing
> a
> > Dynamic import statement on * in order to give access to all class to the
> > wicket framework.  For me, it would be greatly easier to take the system
> > bundle (the framework instance) and ask it to resolve in the exportable
> > package of the system.
> > Is there a way to configure the framework to work like the dynamic import
> > statement?  Since there is no real manifest, how can I specify this?
> >
> In Apache Sling we have a similar issue: we support scripting and these
> scripts in the first place run outside of an OSGi context. But as you
> may want to access all available exported classes, we created a special
> class loader for this. This class loader uses the package admin for
> loading classes.
>
> Apache Sling has a bundle, the commons classloader (just released as
> version 1.0.0) which has no dependencies to Sling and provides a service
> which gives you this dynamic class loader. Under the covers this class
> loader also handles bundle updates, installs, uninstalls.
>
> Before we had the class loader we used dynamic import * as well :)
>
> Carsten
>
> --
> Carsten Ziegeler
> cziegeler@apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Having access to all exported class from framework

Posted by Carsten Ziegeler <cz...@apache.org>.
Marc-Andre Houle wrote:
> Hello all,
> 
> I'm using felix as my OSGi framework to make my already created application
> modular.  Basically, we are using the OSGi system to plugin in module at
> boot and make them available to the UI. We are using wicket as our web
> framework. To load the felix system, I'm using the 4.2 generic method of
> OSGi to get a FrameworkFactory and then a framework instance.
> 
> Since the Wicket is actively using the class searching mechanism instead of
> using class forname directly, it is possible for my to also search into the
> OSGi system. Presently, I implemented a bundle with a manifest containing a
> Dynamic import statement on * in order to give access to all class to the
> wicket framework.  For me, it would be greatly easier to take the system
> bundle (the framework instance) and ask it to resolve in the exportable
> package of the system.
> Is there a way to configure the framework to work like the dynamic import
> statement?  Since there is no real manifest, how can I specify this?
> 
In Apache Sling we have a similar issue: we support scripting and these
scripts in the first place run outside of an OSGi context. But as you
may want to access all available exported classes, we created a special
class loader for this. This class loader uses the package admin for
loading classes.

Apache Sling has a bundle, the commons classloader (just released as
version 1.0.0) which has no dependencies to Sling and provides a service
which gives you this dynamic class loader. Under the covers this class
loader also handles bundle updates, installs, uninstalls.

Before we had the class loader we used dynamic import * as well :)

Carsten

-- 
Carsten Ziegeler
cziegeler@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org