Skip to main content

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: 112
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.
Previous Topic:OSGi services and thread-safety
Next Topic:EModelService.find never matches with MMenuItem
Goto Forum:

Current Time: Wed Jul 18 23:51:09 GMT 2018

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

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

Back to the top