If you use method injection your method gets called and you can react on
Am 01.11.12 11:07, schrieb Christian Eugster:
> I have read, that the Eclipse4 DI framework does reinject a service if
> it has changed. Does it do this in a "silent way" or what opportunity
> has the "client" to react on this change?
> E.g. I use a service to get instances from a database. If that service
> stops running, I want to remove the instances from the ui. How can I
> accomplish this?
Christian Eugster Messages: 149 Registered: July 2009 Location: St. Gallen Switzerland
So do I misunderstand something? I thought that @Optional does not prevent the method call, but does not throw an exception. When I want to be noticed about a service stops, how do I implement this then?
Sopot Cela Messages: 597 Registered: December 2010
It depends what you mean by "service stops" do you have a mechanism to null the service in the context when something happens? The framework can not "automatically" check and act when a service "stops" as it is a bit ambiguous what you call stop.