mathieuancelin / weld-osgi

This project aims to provide an OSGi integration for Weld. This project is no longer updated, see https://github.com/weld/core for updates
https://github.com/weld/core
12 stars 10 forks source link

Injected context, headers and file from an specified bean bundle should be proxied and dynamic #72

Closed arcane86 closed 13 years ago

arcane86 commented 13 years ago

When you inject a bundle context, bundle header, bundle file or bundle reference of a bean bundle (A) in another bean bundle (B) you might got null reference even if both bundles A and B are active. It occurs when the injection in bundle B is performed before bundle A becomes active.

Any call on the injected reference in bundle B should be a success if bundle A is active and a fail if bundle A is inactive at the time of the call (and not the injection).

Currently bundle reference are already proxied and thus dynamic.

arcane86 commented 13 years ago

BundleContext is proxied. Bundles headers are working if the bundle is present is the OSGi environment (not necessarily active), but should be proxied because the bundle might installed latter.

We need to find a way to proxy injected file (java.io.File) but I can't find a nice way to do it. Java Proxy need an interface and redefine all methods from File seems ugly.

mathieuancelin commented 13 years ago

We don't allow cross bundle injection for these types