Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Injection of Death(Why injecting a certain class during plugin activation breaks all internal OSGi functionality)
Injection of Death [message #1697542] Thu, 04 June 2015 16:45
Piero Campalani is currently offline Piero CampalaniFriend
Messages: 110
Registered: January 2015
Senior Member

Dear experts,

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.
Best,
-Piero
Previous Topic:Conflicting Handlers on Migration
Next Topic:EModelService.find never matches with MMenuItem
Goto Forum:
  


Current Time: Sun Oct 22 21:20:52 GMT 2017

Powered by FUDForum. Page generated in 0.02082 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software