|Injection of Death [message #1697542]
||Thu, 04 June 2015 16:45
| Piero Campalani
Registered: January 2015
it happened my application got miserably broken after I decided to inject a certain object fooObj in my Eclipse context form the bundle Activator.
Mind that fooObj is just one more object I injected this way, other objects did not actually break anything.
I am not sure that posting the source of this FooClass would be useful or not. Would it?
The situation is: in my bundle activator I inject the "lifecycle handler", which is supposed to start the application only after the GUI parts/viewers are created:
the E4 model class alerts she's done (class is female.) building viewers by sending an event via broker, which wakes up the lifecycle handler that starts up all the logic/control/business classes of the plugin.
At first I did not implement the handler as a declarative event handler, but instead I injected it from the activator, and created a listener method (@Optional @EventTopic). I did not notice that this was called in the same moment the injected object was created by the activator, so startup was immediate.
To fix this, and separate bundle activation and plugin startup, I declared the lifecycle handler in my OSGI-INF/ folder and now the handler is waken up at the right time.
This is getting messy: did I explain the scenario clearly enough?
Anyway, I would like to understand what was the possible conflict there so that I can be wiser tomorrow.
Any help investigating is highly appreciated.
Powered by FUDForum
. Page generated in 0.02082 seconds