| Summary: | support disabling auto-activation temporarily | ||
|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Rafael Chaves <eclipse> |
| Component: | Framework | Assignee: | equinox.framework-inbox <equinox.framework-inbox> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | 3.2 | ||
| Target Milestone: | 3.3 | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Rafael Chaves
An interesting proposal. Would it be bad for people to suddnely start getting ClassNotFoundErrors? I'm not sure I understand what is being asked. Are you requesting an enhancement to Eclispe-LazyStart to list a set of classes that should not cause the bundle to be started lazily AND should not be allowed to load unless the bundle is already started? If that is the case who needs to be aware that a ClassNotFoundException will be thrown depending on if the bundle is active or not? Re: comment 1 - the exception message could contain an explanation why the framework refused to load a class ("auto-activation is forbidden"). The client of the proposed feature wants to make sure its clients are well-behaved. A class not found exception here means a bug in the client code (that should not be loading classes that would trigger auto-activation). Re: comment 2 - what is being requested here is API for running runnables for whose duration auto-activation is forbidden. I don't know about Eclipse-LazyStart (did you mean Eclipse-AutoStart?), but no changes to manifest headers are needed. The implementation could be based on thread locals. Before running the client provided runnable, an AUTO_ACTIVATION_FORBIDDEN thread local would be set to true. Before starting a bundle, the EclipseClassLoader would check if auto activation is forbidden. If it is, it should throw a ClassNotFoundException. I am not familiar enough with Java classloading to be 100% sure this is implementable. For instance, are missing classes always looked up, or if the lookup fails for the first time, we don't bother doing the lookup again? If that is the case, then I don't think this can be implemented. The problem you describe sounds very similar to bug 131966, although the solutions are different. Rafael do you agree? Can we dup this bug to bug 131966? If that approach has better chances of being implemented, I am fine with this being marked as duplicate. |