On Aug 21, 2008, at 9:29 AM, Thomas Watson wrote:

I don't think any implementation enforces this. I don't even think it is possible because in many cases classes will already be loaded and running. The running code is out of the frameworks hands. The only thing that could be done is to force class loading exceptions or security exceptions when a bundle is stopped. But that would violate the specification because classes are allowed to be loaded and executed from a bundle in the RESOLVED state.


It can be done. The frameworks bundle classloader can instrument the bundle's classes as they are loaded. Not ideal but it's do-able.

I think the statement is meant bundle developers to make them aware that using such a pattern will leave them in a strange state because they will have a thread that is still running code but will not have access to a valid BundleContext.


That makes sense.  In this case the spec wording needs to be updated.


Regards,
Alan

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to