I know as little as BJ does about ZK... however, if those resources are
being loaded from bundles then you may be able to assume that the class
names they refer to are classes either contained in visible from the same
bundle that contained the resource. In which case you could use the
Bundle.loadClass() method.

If this doesn't help then I think you will need to rephrase the problem
without reference to ZK concepts.

Regards
Neil

On Tue, Jun 7, 2011 at 9:03 PM, Martin Petzold <[email protected]> wrote:

>  Am 07.06.2011 20:16, schrieb BJ Hargrave:
>
> Have considered implementing your own HttpContext object? You can then do
> whatever custom lookup mechanism you want.
> --
>
>     Seems reasonable to have a look at this. Could be a nice approach for
> resource lookup (e.g. *.zol). But what about the controller classes
> referenced in the resources? Objects of these get instantiated by the ZK
> implementation on the fly and thus use its classloader.
>
> So what would be best practice loading classes (importing packages) in/from
> referenced/tracked bundles dynamically?
>
> Thanks,
>
> Martin
>
>
>    **
>
>
>
> From:        Martin Petzold <[email protected]> <[email protected]>
> To:        OSGi Developer Mail List 
> <[email protected]><[email protected]>
> Date:        2011/06/07 13:57
> Subject:        [osgi-dev] ZK Web Application Framework with OSGi
> Sent by:        [email protected]
>
> ------------------------------
>
>
>
> Hi osgi-devs,
>
> we are working on the integration of ZK (http://www.zkoss.org) in an
> OSGi environment. We would like to have the two ZK servlet registrations
> seperated from the x web content/applications (xml files, classes and
> resources). We have got one ZK bundle that registeres the servlets
> (using PAX Web) and x other bundles with *.zol resource files,
> controller classes and other resources.
>
> ZK looks up resources on the classpath, so we need some mechanism to add
> the resources of other bundles (dynamically) to this classpath. For now
> we have identified two possibilities:
>
> 1. Use fragment bundles (host is ZK bundle): Resources would be found
> and this works out. But we don't have that loose coupling and also no
> separat classloader and less powerful lifecycle.
>
> 2. Use regular bundles: Export all packages containing resources and use
> "Dynamic-ImportPackage" in the ZK bundle.
>
> 2b. I think it could be possible to use an extender pattern and track
> these bundles from the ZK bundle, then import packages/resources that
> have been declared somehow dynamically (in Manifest)?! Via resolver hook
> or what is capable of this?
>
> What do you think is best and are there any other patterns we could use?
> Is this even somehow possible on service layer level?
>
> Big thanks in advance,
>
> Martin
>
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
>
> _______________________________________________
> OSGi Developer Mail 
> [email protected]https://mail.osgi.org/mailman/listinfo/osgi-dev
>
>
>
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to